This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/10947] New: ++ postfix operator increments too soon
- From: "bmead15 at cox dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 May 2003 02:26:05 -0000
- Subject: [Bug c/10947] New: ++ postfix operator increments too soon
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10947
Summary: ++ postfix operator increments too soon
Product: gcc
Version: 3.2.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: bmead15@cox.net
CC: gcc-bugs@gcc.gnu.org
GCC host triplet: I am sorry I don't know what goes in here
With the following line of code:
*s++ = toupper(*s);
The 3.2.2 gcc increments s before the value is determined on the right side of
the equal sign. So what happens is *s gets the value of toupper(*s+1) not
toupper(*s)
The bug did not occur in version 3.1.1 of gcc. I have not run tests on versions
in-between these versions. The gcc version 3.2.2 is the standard one that is
included in the Mandrake Linux 9.1 distribution. If a known fix for this is
possible by recompiling gcc 3.2.2 or upgrading to a newer gcc please let me know.
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.