This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/37800] decrementation problem - different result in similar situations
- From: "terrix at wp dot pl" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Oct 2008 16:57:50 -0000
- Subject: [Bug c++/37800] decrementation problem - different result in similar situations
- References: <bug-37800-16817@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from terrix at wp dot pl 2008-10-10 16:57 -------
i'm not really sure why there maight be a difference in incrementation behavior
between:
foo(++p, p);
and
foo(++p, p - 1);
looking at the code it is obvious that '++p' is a first operation and the 'p'
or in second example a 'p-1' is a second operation. both operations are done
before call to a foo. isn't it?
so why behaviour of second example is that 'p-1' is executed first and than
'++p'?
note that in other compillers (m$vc), not mentioning other languages (java),
behavious of exampled code is obvious and clear.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37800