Stack push order for function arguments
A quick experiment revealed function arguments to be pushed onto the stack from "right to left".
void test (int a, int b);
Pushes b first and only then a. Local variables are otherwise pushed as expected following the order of declaration.
I'm just curious as to why arguments are pushed this way and if I can expect this to be standard behavior across compliant compilers.
And since we are on the subject, probably a silly question... If this is indeed standard behavior doesn't this mean order of argument initialization is fixed and thus a language feature that allowed default values to evaluate formal arguments would be possible?
Something like void test (int a = b + c, int b = c, int c = 1);
I'm unsure of the utility of such feature... not to mention a, b and c haven't been declared at that point... but the thought crossed my mind.