home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!usc!news.service.uci.edu!beckman.com!dn66!a_rubin
- Newsgroups: comp.lang.c
- Subject: Re: applying or
- Message-ID: <a_rubin.726512278@dn66>
- From: a_rubin@dsg4.dse.beckman.com (Arthur Rubin)
- Date: 8 Jan 93 16:57:58 GMT
- References: <1993Jan1.184655.7023@viewlogic.com> <1993Jan06.002044.795@microsoft.com>
- Organization: Beckman Instruments, Inc.
- Nntp-Posting-Host: dn66.dse.beckman.com
- Lines: 28
-
- In <1993Jan06.002044.795@microsoft.com> russpj@microsoft.com (Russ Paul-Jones) writes:
-
-
- >So, there are some instances where this optimization might be made:
-
- >b = 4;
- >if (a*7)/3 > 100/a || b
- > fred();
-
- >I would say that fred() may be called without evaluating the silly
- >expression, even if a == 0. But I would suspect that it would take
- >a fairly clever compiler to safely find many of these instances.
-
- I don't think so. (Well, in this example, it's permitted, as the
- expression has no side effects except divide-by-0, the results of which are
- undefined, but...)
-
- b = 4;
- if (a*7)/3 > 100/a++ || b
- fred();
-
- is a different matter.
-
- --
- Arthur L. Rubin: a_rubin@dsg4.dse.beckman.com (work) Beckman Instruments/Brea
- 216-5888@mcimail.com 70707.453@compuserve.com arthur@pnet01.cts.com (personal)
- My opinions are my own, and do not represent those of my employer.
- My interaction with our news system is unstable; please mail anything important.
-