expression sequencing bugs

Chris Sylvain don at umd5
Thu Oct 2 00:12:01 AEST 1986


In article <4197 at brl-smoke.ARPA> C90630JG%WUVMD.BITNET at wiscvm.ARPA writes:
>In article <760 at oakhill.UUCP> tomc at oakhill.UUCP (Tom Cunningham) writes:
>>    /* a = b + b + b */
>>    a = ((b=1),b) + ((b=2),b) + ((b=3),b)
>>
>>I expected the result to be 6.  With the Microsoft C compiler and the
>>compiler on the Sun 3, the result is 9.  Apparently the parenthetical
>>assignments are all getting done before the comma and addition.  Any
>>thoughts on this?
> ........
>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.
>Mike Stump  ucbvax!hplabs!csun!csunb!beusemrs
>
The microVAX running Ultrix V1.2 that I am using insists the result
is 9.
Has anyone tested 4.3BSD yet?

-- 
--==---==---==--
.. Long time the manxome foe he sought -- ..

ARPA: don at umd5.UMD.EDU     BITNET: don%umd5 at umd2
UUCP: ..!{ seismo!umcp-cs, ihnp4!rlgvax }!cvl!umd5!don

** WARNING: don at mimsy.UMD.EDU is a different person **
** (umcp-cs and mimsy.umd.edu are the same machine) **
**   -->   Please double-check the address   <--    **



More information about the Comp.lang.c mailing list