expression sequencing bugs

J. Hodgson jhodgson at sjuvax.UUCP
Fri Oct 10 11:31:07 AEST 1986


 I ran the (in)famous 
	a= ((b=1,b)) + ((b=2,b)) + ((b=3,b))
on three different versions of C. I got 6 from MIX.C (for reasons I understand,
it works left to right), 9 from the C that comes in 4.3 BSD, which I also
understand (all the left hand parts first) and 7 (!!) from an early Lattice C.
I can derive two explanations for this and confess that I did not bother to try
the 1,2,4 version that might have shown which was the right one. In any case
I haven't seen 7 claimed yet, so I do it now!



More information about the Comp.lang.c mailing list