Multiple assignements

Gavin Romig-Koch gavin@cygnus.com
Tue Aug 31 22:45:00 GMT 1999


seba writes:
 > I've tried the little program attached below on these different
 > compilers:
 >  ...
 > with no particular command-line options, the output was different. Maybe
 > the behaviour is undefined in this case ? Thanks.

Yes.  In this statment:

   p2->next->prev = p2->next = p2;

It is undefined whether the first "p2->next" is evaluated before 
or after the assignment to "p2->next".

                                         -gavin...



More information about the Gcc-bugs mailing list