On Sunday 11 September 2005 03:39, Anders Johansson wrote:
On Saturday 10 September 2005 17:47, Jerry Feldman wrote:
Just to add to Anders comments. According to the ANSI 89 standard, this is an unspecified operation. The issue here is when the postincrement operator is applied to s. C pushes variables from the last to the first because it may have an unknown number of parameters.
This is a completely unwarranted assumption. This may be the way any one compiler works (and it does make sense), but according to 6.5.2.2 of the 1999 standard
"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"
So while I'm sure you're right about any one compiler, it is very wrong to say that C does it, and suicidal to rely on it
I agree; you need to look at your own compilerS. I add the S because linking object code from two different languages can get one into a lot of trouble if they don't obey the same rules. Also one should note that some compilers pass addresses (best in my opinion) while others pass "values". (Values? C passes values sometimes and addresses if it feels like it, so be careful.) And some compilers pass 'hidden' information. So: Why in hell would anybody want to pass something as dumb as s++ ? Us old farts use K.I.S.S. Regards, Colin