Article View: comp.std.c
Article #4422Re: On sequence points and evaluation order
From: Mark Brader
Date: Wed, 06 Dec 1995 00:05
Date: Wed, 06 Dec 1995 00:05
30 lines
1592 bytes
1592 bytes
To the question: > > > Is `i + (f(),i+i)' well defined? Chris Volpe (volpe@ausable.crd.ge.com) writes: > It must yield one of two values, in an unspecified way, depending on which > of the two operands of the top-level "+" is evaluated first. (I've lost > some context here, but I assume f() modifies i.) I wouldn't call this > "well-defined", but it does not invoke undefined behavior either. I agree with everything here and, I believe, in the rest of Chris's long article, *except* the implication that one of the two operands of the top-level + must be evaluated first. I don't think Chris really meant to make that implication. The evaluation sequence f() left-hand i right-hand i right-hand + top-level + is one of the possibilities, and the left-hand operand of the top-level + is evaluated within the time that the right-hand operand is being done. -- Mark Brader \ Peter Neumann on updating software to work after 1999: msb@sq.com \ This problem gives new meaning to "going out on a date" SoftQuad Inc., Toronto \ (which many systems will do on 1/1/00). My text in this article is in the public domain.
Technical Details
Message-ID:
<1995Dec6.000503.6676@sq.com>Path:
arc1-ca.pugleaf.net!nntp.coast.net!torn!sq!msbReferences:
<49l428$od0@bolverk.cs.cornell.edu> <49ojjp$hsm@newshost.lanl.gov> <49qiu7$25h@natasha.rmii.com> <49v3ii$nve@rdsunx.crd.ge.com>Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c Path: arc1-ca.pugleaf.net!nntp.coast.net!torn!sq!msb From: msb@sq.com (Mark Brader) Subject: Re: On sequence points and evaluation order Message-ID: <1995Dec6.000503.6676@sq.com> Organization: SoftQuad Inc., Toronto, Canada References: <49l428$od0@bolverk.cs.cornell.edu> <49ojjp$hsm@newshost.lanl.gov> <49qiu7$25h@natasha.rmii.com> <49v3ii$nve@rdsunx.crd.ge.com> Date: Wed, 6 Dec 1995 00:05:03 GMT