[comp.sys.atari.st] argument passing in C.

pa2183@sdcc15.ucsd.edu (pa2183) (03/25/89)

Several items recently have mentioned argument processing in C.
Since the order of evaluation is un-defined, one must always check
such details when porting or creating code which uses such
side-effects.

To further the confusion, the C ',' (comma) operator is defined to
cause the following to be evaluated from left to right:

	( a = b + c, c = a + b );

Where as the following evaluation order is undefined by the language:


	do_function( a = b + c, c = a + b );

The right to left evaluation and stacking mechanism in many C's
allows the variable argument functions like 'printf' to work with
out special code to find the number of arguments.

I program in C because of the flexibility. Sometimes that
flexiblity will lead to constructs which are not well-defined.
Such is life.

PS. I even used a C 'goto' once.