Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!usc!ginosko!aplcen!haven!adm!smoke!gwyn
From: gwyn@smoke.BRL.MIL (Doug Gwyn)
Newsgroups: comp.std.c
Subject: Re: Semi constant expressions
Message-ID: <10949@smoke.BRL.MIL>
Date: 6 Sep 89 10:28:08 GMT
References: <1237@gmdzi.UUCP> <10885@smoke.BRL.MIL> <1989Sep5.180315.25627@utzoo.uucp>
Reply-To: gwyn@brl.arpa (Doug Gwyn)
Organization: Ballistic Research Lab (BRL), APG, MD.
Lines: 16

In article <1989Sep5.180315.25627@utzoo.uucp> henry@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.