Subtle C's - (nf)

Anonymous at inmet.UUCP Anonymous at inmet.UUCP
Sat May 5 17:11:00 AEST 1984


#R:acf4:-1390000300:inmet:5000014:000:632
inmet!Anonymous    Apr 26 09:09:00 1984

[]

> Another subtle non-equivalence:
> 
> 	while (a) if (b) foo; else bar;
> 
> is not a syntax error, but is not equal to
> 
> 	while (a) { if (b) foo; else bar; }

OK, I give up.  What's the difference?  According to my copy of K&R, they
both have only one parse, and they differ only by the compound-statement
step in the second example.  Thus they shouldn't be different in meaning.
Is there some C compiler that generates different code?  I'd call it a bug.

					John M Chambers [inmet!jc]
					Intermetrics, Inc.
					735 Concord Ave.
					Cambridge, MA 02138
"I don't have any solution but I certainly admire the problem."



More information about the Comp.lang.c mailing list