Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uunet!mcsun!ukc!stl!stc!rmj From: rmj@tcom.stc.co.uk (The Beardless Wonder) Newsgroups: comp.lang.c Subject: Re: Is something wrong with the compiler ? Message-ID: <2043@jura.tcom.stc.co.uk> Date: 3 Oct 90 12:19:10 GMT References: <884@gtenmc.UUCP> <1990Sep26.175948.8232@zoo.toronto.edu> <189@thor.UUCP> <1895@tuvie> Reply-To: rmj@htc2.UUCP (The Beardless Wonder) Organization: STC Telecomms, Harlow Technical Centre, Harlow Lines: 27 In article <1895@tuvie> hp@vmars.tuwien.ac.at (Peter Holzer) writes: }scjones@thor.UUCP (Larry Jones) writes: } }>In article , burley@world.std.com (James C Burley) writes: }>> > a = ( int )(( unsigned ) ( a = ~0 ) >> 1 )); }>> } }>No, '=' is not a sequence point. The question in this case is not when }>the lhs gets evaluated, but when the actual storage of the rhs into the }>lhs is done. A compiler would be completely within its rights to store }>the final result into a and then overwrite it with ~0. } }Yes, but the variable 'a' was not used afterwards, so we are not }interested in the value of a, but in the value of the complete }expression, which is IMHO well defined (The standard says in 3.3.16: }An assignment expression has the value of the left operand after the }assignment). The whole point is that "Afterwards" is not a well-defined concept here. The value of the assignment expression is as you say, but as Larry says the value that 'a' has on the far side of the semicolon could be ~0 without contravening the standard. -- * Windsinger * "But soft, what light through yonder * rmj@islay.tcom.stc.co.uk * airlock breaks?" * rmj@tcom.stc.co.uk * --RETURN TO THE FORBIDDEN PLANET * rmj10@phx.cam.ac.uk * You've gotta be cruel to be Khund!