🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.c
Article #9503

Re: expression sequencing bugs

#9503
From: John Pierre
Date: Mon, 06 Oct 1986 18:04
23 lines
1499 bytes
In article <1269@umd5> don@umd5.umd.edu (Chris Sylvain) writes:
>In article <4197@brl-smoke.ARPA> C90630JG%WUVMD.BITNET@wiscvm.ARPA writes:
>>In article <760@oakhill.UUCP> tomc@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?
>

4.3BSD's cc(1) produces a value of 9.

-john pierre  
Technical Details
Message-ID: <3393@mit-eddie.MIT.EDU>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!husc6!panda!genrad!mit-eddie!jpierre
References: <4197@brl-smoke.ARPA> <1269@umd5>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!husc6!panda!genrad!mit-eddie!jpierre
From: jpierre@mit-eddie.MIT.EDU (John Pierre)
Newsgroups: net.lang.c
Subject: Re: expression sequencing bugs
Message-ID: <3393@mit-eddie.MIT.EDU>
Date: Mon, 6-Oct-86 14:04:39 EDT
Article-I.D.: mit-eddi.3393
Posted: Mon Oct  6 14:04:39 1986
Date-Received: Wed, 8-Oct-86 00:18:00 EDT
References: <4197@brl-smoke.ARPA> <1269@umd5>
Reply-To: jpierre@mit-eddie.UUCP (John Pierre)
Organization: MIT, EE/CS Computer Facilities, Cambridge, MA
Lines: 23