lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Am 21.02.2013 22:42, schrieb Sean Conner:

[...]

   -spc (So, why does it trigger on parameter 3 first?  Because of the rules
	of C when evaluating parameters of a function---they're evaluated
	from right to left.  Why that way?  I'll leave that as an exercise
	for the reader ... )

That was a trick question, of course. And the answer is: Bad Luck!
According to C89, 3.3.2.2 "Function calls":
> [...]
>    The order of evaluation of the function designator, the arguments,
> and subexpressions within the arguments is unspecified, but there is a
> sequence point before the actual call.

Philipp