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]
Other format: [Raw text]

[Bug c++/22248] Incorrect work with multiple assigment.


------- Additional Comments From gdr at integrable-solutions dot net  2005-06-30 13:19 -------
Subject: Re:  New: Incorrect work with multiple assigment.

"algorithmus at gmail dot com" <gcc-bugzilla@gcc.gnu.org> writes:

| ---new.cpp----
| #include<cstdio>
| 
| #define swap(a,b) a^=b^=a^=b

You're modifying objects more than once without intervening sequence
points.  All bets are off. There is a standard utility std::swap() from
<utility> that works all the time.
PR invalid.

-- Gaby


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22248


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