Newsgroups: comp.std.c Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: Semi constant expressions Message-ID: <1989Sep5.180315.25627@utzoo.uucp> Organization: U of Toronto Zoology References: <1237@gmdzi.UUCP> <10885@smoke.BRL.MIL> Date: Tue, 5 Sep 89 18:03:15 GMT In article <10885@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn) writes: >> 0 * x (x non-constant) > >This falls naturally out of the specification. The operands ARE evaluated, >so if `x' has side-effects they do occur... in cases where the >behavior is well defined the only short cuts permitted are those that >produce the same results as doing it the long way. A historical note on this... ------------- From decvax!harpo!eagle!mhtsa!alice!research!dmr Mon Jan 31 02:52:38 1983 Subject: foo()*0 Newsgroups: net.lang.c A couple of years ago I changed my C compiler not to throw out 0*x, 0&x, and the like where x is an expression with side effects. I believed then and now that anyone who depended on such things was mad, and the recent examples have not convinced me otherwise. However, it was much easier to change the compiler than to attempt to argue the implausibility of each carefully crafted example... Dennis Ritchie ------------- -- V7 /bin/mail source: 554 lines.| Henry Spencer at U of Toronto Zoology 1989 X.400 specs: 2200+ pages. | uunet!attcan!utzoo!henry henry@zoo.toronto.edu