expression sequencing bugs

Angus Christie 6101778 at PUCC.BITNET
Fri Oct 3 11:47:23 AEST 1986


>>    /* a = b + b + b */
>>    a = ((b=1),b) + ((b=2),b) + ((b=3),b)
>>
 [with various results for a]
>I would like everyone to test it on as many machines as prossible, to
>see if we can find as least ONE other besides Small-C, that works.
 
MIX-C for the IBM-PC also gives an answer of 6 for all three of the
following:
 
     a = ((b=1),b) + ((b=2),b) + (b=3),b);
     a = (b=1) + (b=2) + (b=3);
     a = (b=1), a += (b=2), a += (b=3);
 
Beware, however, that MIX-C accomplishes this by doing absolutely NO
optimization of any sort.  It doesn't fold constants.  It has no register
variables.  Its execution speed, as a result, leaves something to be
desired.  But then again, what do you expect for only $40.



More information about the Comp.lang.c mailing list