Quote:
Originally Posted by jesusdiehard
sorry, i m not getting your undefined behavior theory.
To my best knowledge, arguments are loaded on stack in C from right to left and after loading each arguments, excecution sequence change the variable's value.
I have checked the code on VC++, and i m quite sure on GCC it is going to give the same result.
My terminology was incorrect; my apologies. The behaviour is "unspecified" as
stated by the C99 standard:
Quote:
[#10] The order of evaluation of the function designator,
the actual arguments, and subexpressions within the actual
arguments is unspecified, but there is a sequence point
before the actual call.
Unspecified behaviour is defined as follows:
Quote:
3.19
[#1] unspecified behavior
behavior where this International Standard provides two or
more possibilities and imposes no requirements on which is
chosen in any instance
[#2] EXAMPLE An example of unspecified behavior is the
order in which the arguments to a function are evaluated.
kind regards,
Jos