Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!ames!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: still problems with ?: Message-ID: <10409@smoke.BRL.MIL> Date: 16 Jun 89 21:25:33 GMT References: <10387@smoke.BRL.MIL> <568@lakart.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 22 In article <568@lakart.UUCP> dg@lakart.UUCP (David Goodenough) writes: >gwyn@smoke.BRL.MIL (Doug Gwyn) sez: >> In article <4675@alvin.mcnc.org> spl@mcnc.org.UUCP (Steve Lamont) writes: >>>>((a = *p++) && e2 ) || (!a && e3) >> There has never been any ambiguity about the correct sequence of >> operations during evaluation of such an expression (except when >> `p' is used in `e2' or `e3'). >... Of course if your going to tell me that the standard >says that the a = *p and the p++ may happen at different times (i.e. the >p++ after e2), then I'm going to say the standard is broken. No, the Standard specifies that there is a sequence point after the evaluation of the first operand of && (also ||). However, we were discussing pre-Standard C and what were universally understood to be the rules back then versus what was considered not clearly specified. In K&R1, the sequencing of side effects was not clearly specified, and consequently some C implementations deferred the side effects in surprising ways, which is the point of my parenthetical comment above. X3J11 came up with the concept of "sequence points" to permit accurate constraint specification in this area.