Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!cs.uoregon.edu!ogicse!intelhf!ichips!inews!nevin!bhoughto From: bhoughto@nevin.intel.com (Blair P. Houghton) Newsgroups: comp.std.c Subject: Re: More Re: Function Argument Evaluation argument Message-ID: <3731@inews.intel.com> Date: 9 Apr 91 08:03:31 GMT References: <18140@crdgw1.crd.ge.com> <1991Apr6.022220.6449@twinsun.com> <1991Apr8.191009.24897@cs.ucla.edu> Sender: news@inews.intel.com Organization: Intel Corp, Chandler, AZ Lines: 40 In article <1991Apr8.191009.24897@cs.ucla.edu> jon@maui.cs.ucla.edu (Jonathan Gingerich) writes: >In article <1991Apr6.022220.6449@twinsun.com> eggert@twinsun.com (Paul Eggert) writes: >> >>While the ANSI standard does not clearly address this point, Jim Brodie >>has reported [Journal of C Language Translation 2, 3 (Dec. 1990), 207-215] >>that the general opinion of X3J11 seems to be that the sequence point >>in an expression X=F(Y) prior to the call to F causes only a partial >>ordering on the subexpressions F and Y; it does not control the >>ordering of other subexpressions like X. From this, I would expect Huh? F and Y both must be evaluated prior to that sequence point. If this is what is meant by "partial ordering" (the common beforeness is defined, but not the actual order of the two wrt each other), then no problem. >Earlier I claimed: > > printf("%d %d\n", f(...v...), f(...v++...)) [...] >would always leave x even. In my previous example however, I believe that v >and v++ could be evaluated before either s.p. thus it is undefined. Again, it's confused. There are two sequence points among the arguments to printf(); they are the calls to the function f(). Sequence points are defined in terms of their proscriptions on side effects. Since `v++' has a side effect (the assignment of v+1 to v), it must be evaluated after the preceding sequence point and prior to the sequence point defined by the rightward call to f(). It is unspecified whether the preceding sequence point comes from some earlier statement or from the leftward call to f(). However, the first usage of `v' has no side effects. It can be evaluated regardless of sequence points other than the one for the leftward call to f(). The value for `v' in the leftward call is indeterminate. --Blair "I gotta start bringing the standard home with me?"