This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Multiple assignements


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...


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]