Article View: comp.std.c
Article #4456Re: On sequence points and evaluation order
From: Christopher R. Volpe
Date: Fri, 08 Dec 1995 16:04
Date: Fri, 08 Dec 1995 16:04
40 lines
2519 bytes
2519 bytes
In article <4a73n0$jfu@newshost.lanl.gov>, tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya) writes: |>In article <4a6r9u$hq5@rdsunx.crd.ge.com>, volpe@bart.crd.ge.com (Christopher |>R. Volpe) writes: |><snip> |>|> |>this to satisfy the _unsatisfiable_ edict of `statements are evaluated |>|> |>in sequence': after all `f()+f();' is a statement --- is it done |>|> |>before or after the statements comprising f? |>|> |>|> It's not unsatisfiable, because the edict includes the phrase "except where |>|> otherwise specified", and function calls are one of those exceptions. |> |>And 6.3 `the order of evaluation of subexpressions and ... are both |>unspecified' (i.e. the clause which allowed interleaved expressions in the |>first place) does not count as `except where otherwise specified'? In my opinion, no. What does the order of evaluation of subexpressions have to do with statement sequencing? (Except in the case of function calls, which I already mentioned.) |> If the |>sequence point on both sides of i++ still leaves i + (a,i++,b) undefined; why |>should i + f() where f() is a; i++; b; be any different? Because the commas in "(a,i++,b)" do not delimit statements. |> |>Or rather, not why should it be different: it can be different by fiat. But, |>I do not see even the genesis of the claim that the standard currently |>specifies it clearly. I admit that it's not so cut and dry. There is definitely room for argument here. But in my opinion, Once control is transferred to the function, leaving the function to go compute something else in the calling expression constitutes a break in the statement sequence. -- Chris Volpe Phone: (518) 387-7766 (Dial Comm 8*833 GE Corporate R&D Fax: (518) 387-6560 PO Box 8, Schenectady, NY 12301 Email: volpecr@crd.ge.com
Technical Details
Message-ID:
<4a9nn0$3hn@rdsunx.crd.ge.com>Path:
arc1-ca.pugleaf.net!bart.crd.ge.com!volpeReferences:
<49l428$od0@bolverk.cs.cornell.edu> <49ojjp$hsm@newshost.lanl.gov> <49qiu7$25h@natasha.rmii.com> <49v3ii$nve@rdsunx.crd.ge.com> <1995Dec6.000503.6676@sq.com> <TANMOY.95Dec5221739@qcd.lanl.gov> <4a6r9u$hq5@rdsunx.crd.ge.com> <4a73n0$jfu@newshost.lanl.gov>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!bart.crd.ge.com!volpe From: volpe@bart.crd.ge.com (Christopher R. Volpe) Newsgroups: comp.std.c Subject: Re: On sequence points and evaluation order Date: 8 Dec 1995 16:04:48 GMT Organization: GE Corporate Research & Development Sender: volpe@bart (Christopher R. Volpe) Distribution: world Message-ID: <4a9nn0$3hn@rdsunx.crd.ge.com> References: <49l428$od0@bolverk.cs.cornell.edu> <49ojjp$hsm@newshost.lanl.gov> <49qiu7$25h@natasha.rmii.com> <49v3ii$nve@rdsunx.crd.ge.com> <1995Dec6.000503.6676@sq.com> <TANMOY.95Dec5221739@qcd.lanl.gov> <4a6r9u$hq5@rdsunx.crd.ge.com> <4a73n0$jfu@newshost.lanl.gov> Reply-To: volpe@ausable.crd.ge.com NNTP-Posting-Host: bart.crd.ge.com