Semi constant expressions

Doug Gwyn gwyn at smoke.BRL.MIL
Wed Sep 6 20:28:08 AEST 1989


In article <1989Sep5.180315.25627 at utzoo.uucp> henry at utzoo.uucp (Henry Spencer) writes:
>From decvax!harpo!eagle!mhtsa!alice!research!dmr Mon Jan 31 02:52:38 1983
>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...

I think most of us would agree that it is "mad" to write such an
expression.  However, C provides a preprocessor which is perfectly
capable of rewriting an innocuous expression so that such a case
results.  Depending on configuration parameters, one's code could
mysteriously malfunction yet look reasonable when you stare at the
source code.  It is "friendlier" for patent operations in  the
source code to actually be performed as the programmer intended.



More information about the Comp.std.c mailing list