Article View: comp.std.c
Article #2622Re: Function Argument Evaluation
From: Christopher R Volpe
Date: Thu, 28 Mar 1991 14:36
Date: Thu, 28 Mar 1991 14:36
26 lines
1875 bytes
1875 bytes
In article <15607@smoke.brl.mil>, gwyn@smoke.brl.mil (Doug Gwyn) writes: |>In article <17936@crdgw1.crd.ge.com> volpe@camelback.crd.ge.com (Christopher R Volpe) writes: |>>The only reason the output of the program in question can be |>>"200 200" is because the BEHAVIOR of the PROGRAM (right Doug?) is |>>undefined because the program violates the "shall" rule in paragraph |>>2 of 3.3, ... |> |>NO -- my original argument did NOT rely on undefined behavior. It |>relied on the unspecified order of evaluation of the subexpressions. |>Even without the cited "shall" in the standard, "200 200" would have |>been a valid output (but not "42 3.1416"). But the only reason you were able to produce an order of evaluation that resulted in "200 200" is because the program did something it should never have done in the first place, which was to modify p twice between sequence points. I would be very interested in seeing a program whose behavior was *not* undefined, yet could arbitrarily produce either of two drastically different outputs depending solely on the unspecified order of evaluation. (By "drastically different" I mean something like "100 200" vs. "200 200". I don't mean something like "12.427" vs. "12.426999".) ================== Chris Volpe G.E. Corporate R&D volpecr@crd.ge.com
Technical Details
Message-ID:
<17983@crdgw1.crd.ge.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!crdgw1!camelback!volpeReferences:
<3461@inews.intel.com> <1991Mar26.181821.22912@cs.ucla.edu> <17936@crdgw1.crd.ge.com> <15607@smoke.brl.mil>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!crdgw1!camelback!volpe From: volpe@camelback.crd.ge.com (Christopher R Volpe) Newsgroups: comp.std.c Subject: Re: Function Argument Evaluation Message-ID: <17983@crdgw1.crd.ge.com> Date: 28 Mar 91 14:36:31 GMT References: <3461@inews.intel.com> <1991Mar26.181821.22912@cs.ucla.edu> <17936@crdgw1.crd.ge.com> <15607@smoke.brl.mil> Sender: news@crdgw1.crd.ge.com Reply-To: volpe@camelback.crd.ge.com (Christopher R Volpe) Lines: 26