Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!crdgw1!camelback!volpe From: volpe@camelback.crd.ge.com (Christopher R Volpe) Newsgroups: comp.std.c Subject: Re: Function Argument Evaluation Message-ID: <18022@crdgw1.crd.ge.com> Date: 29 Mar 91 13:23:07 GMT References: <3461@inews.intel.com> <1991Mar26.181821.22912@cs.ucla.edu> <17936@crdgw1.crd.ge.com> <15607@smoke.brl.mil> <17983@crdgw1.crd.ge.com> <1991Mar28.194627.26285@mtxinu.COM> Sender: news@crdgw1.crd.ge.com Reply-To: volpe@camelback.crd.ge.com (Christopher R Volpe) Lines: 32 In article <1991Mar28.194627.26285@mtxinu.COM>, ed@mtxinu.COM (Ed Gould) writes: |>>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. |> |>Will this do? |> |> foo() { |> int v = 1; |> |> printf("%d %d\n", v, ++v); |> } No, because before the sequence point that occurs before the call, you are modifying v and using v in a way that is not used to determine the new value of v. See my response to Blair's similar example. (Either shortly before or after this post, depending on how things get randomly rearranged over the net.) |> |>-- |>Ed Gould mt Xinu, 2560 Ninth St., Berkeley, CA 94710 USA |>ed@mtxinu.COM +1 415 644 0146 |> |>"I'll fight them as a woman, not a lady. I'll fight them as an engineer." ================== Chris Volpe G.E. Corporate R&D volpecr@crd.ge.com