Semi constant expressions

Henry Spencer henry at utzoo.uucp
Wed Sep 6 04:03:15 AEST 1989


In article <10885 at smoke.BRL.MIL> gwyn at 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 at zoo.toronto.edu



More information about the Comp.std.c mailing list