This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/22248] Incorrect work with multiple assigment.
- From: "gdr at integrable-solutions dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Jun 2005 13:19:07 -0000
- Subject: [Bug c++/22248] Incorrect work with multiple assigment.
- References: <20050630130321.22248.algorithmus@gmail.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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