--- Comment #3 from pinskia at gcc dot gnu dot org 2006-04-21 01:03 ---
(In reply to comment #2)
> than why this one produces expected answer?
As I said it is undefined so it could produce your expected result or it does
not have to. But the example in comment #2 is also undefined for
--- Comment #2 from raphael dot ribas at gmail dot com 2006-04-21 01:01
---
int main() {
int a,b;
a=5;
b=7;
a^=b^=a^=b;
printf("%d %d\n",a,b);
return 0;
}
than why this one produces expected answer?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27233
--- Comment #1 from pinskia at gcc dot gnu dot org 2006-04-21 00:40 ---
a[0]^=b[0]^=a[0]^=b[0];
That is undefined, you are modifing a[0] and b[0] more than once without a
sequence point.
*** This bug has been marked as a duplicate of 11751 ***
--
pinskia at gcc dot gnu dot org chan