Skip navigation.
 
mlRe: GCC not doing the correct thing?
FROM : Cameron Hayne
DATE : Mon Nov 11 23:31:30 2002

On 9/11/02 4:35 pm, "Domain Administrators" <<email_removed>> wrote:

> Forgive me for my impertinence, but if the example code were to be
> "undefined" by definition we would all be in a lot of trouble.


Since this point seems to need a lot of emphasis, allow me to essentially
repeat what Clark Cox has said:
The C++ standard says that the order of evaluation of sub-parts of an
expression is undefined unless explicitly mentioned. And the section on
multiplication does not define the order of evaluation of the left and
right-hand operands in a multiplication. Same thing for addition, etc.
Hence the value of (*ptr++) * (*ptr++) is undefined since it depends on the
order of evaluation of the two multiplicands.

Some people seem to think that the "left-associativity" of multiplication
means that the left operand gets evaluated before the right one. It doesn't
mean that - it merely means that x*y*z is to be evaluated as (x*y)*z. It
says nothing about the order of evaluation of the values x,y,z.

--
Cameron Hayne (<email_removed>)
Hayne of Tintagel
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

Related mailsAuthorDate
mlGCC not doing the correct thing? Andrew Yager Nov 7, 21:53
mlRe: GCC not doing the correct thing? Matthew Fahrenbach… Nov 7, 22:29
mlRe: GCC not doing the correct thing? Cameron Hayne Nov 7, 22:41
mlRe: GCC not doing the correct thing? Stéphane Sudre Nov 8, 02:35
mlRe: GCC not doing the correct thing? Richard Cleis Nov 8, 10:46
mlRe: GCC not doing the correct thing? Clark S. Cox III Nov 8, 10:53
mlRe: GCC not doing the correct thing? Richard Cleis Nov 8, 12:40
mlRe: GCC not doing the correct thing? Domain Administrat… Nov 8, 12:54
mlRe: GCC not doing the correct thing? Clark S. Cox III Nov 8, 13:08
mlRe: GCC not doing the correct thing? Nat! Nov 8, 20:23
mlRe: GCC not doing the correct thing? Andrew Yager Nov 8, 20:29
mlRe: GCC not doing the correct thing? Domain Administrat… Nov 9, 22:35
mlRe: GCC not doing the correct thing? Clark S. Cox III Nov 11, 07:13
mlRe: GCC not doing the correct thing? Thomas Castiglione Nov 11, 13:21
mlRe: GCC not doing the correct thing? Clark S. Cox III Nov 11, 15:21
mlRe: GCC not doing the correct thing? Keith Ray Nov 11, 15:43
mlRe: GCC not doing the correct thing? Clark S. Cox III Nov 11, 15:46
mlRe: GCC not doing the correct thing? Clark S. Cox III Nov 11, 16:12
mlRe: GCC not doing the correct thing? Cameron Hayne Nov 11, 23:31
mlRe: GCC not doing the correct thing? Thomas Castiglione Nov 12, 11:48