More Re: Function Argument Evaluation argument

Jonathan Gingerich jon at maui.cs.ucla.edu
Tue Apr 9 05:10:09 AEST 1991


In article <1991Apr6.022220.6449 at twinsun.com> eggert at 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

Earlier I claimed:

	printf("%d %d\n", f(...v...), f(...v++...))

was unspecified not undefined based on a misapprehension of where the sequence
point in a function calls is.  Looking at K&RII it appears that the s.p. is 
between the evaluation of the arguments (and function name) and the application
of the functions.  I.e.

	x = double_it(x++);

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.

So what about:

	 (*fp)(fp = &g)

???

Jon.



More information about the Comp.std.c mailing list