Incorrect. Associativity just means that (for example):
a = b - c - d;
... must evaluate as:
a = (b - c) - d;
rather than:
a = b - (c - d);
However, for *ANY* of these expressions, the compiler is free to
evaluate b, c, or d in any order it darn well pleases; associativity
only controls how the results are to be combined.
> When seeing:
>
> a = b() + c();
>
> .... the compiler is told to evaluate nothing (void) using
> object 'b', then evaluate nothing using object 'c'.
>
> When seeing:
>
> a = b + c + d;
>
> ... the compiler may still not legally evaluate the objects
> in any order because of associativity, but many/most do.
> Optimization is not yet part of the 'C' standard. When
> attempting to optimize code, certain standards are broken as
> long as the code is likely to work.
>
> Everything makes sense once one understands the '()' operator.
This is just plain WRONG. The C standard is very explicit that there
are no sequence points between the evaluation of the arguments of
addition; in fact, only a few operators have any serialization
property; && and || does, and maybe (I am not sure about this one) the
assignment operators.
-hpa
-- PGP: 2047/2A960705 BA 03 D3 2C 14 A8 A8 BD 1E DF FE 69 EE 35 BD 74 See http://www.zytor.com/~hpa/ for web page and full PGP public key I am Bahá'í -- ask me about it or see http://www.bahai.org/ "To love another person is to see the face of God." -- Les Misérables- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu