This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/17095] New: ++ opertator and + operator is not working together.
- From: "asokumar at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Aug 2004 07:00:33 -0000
- Subject: [Bug c/17095] New: ++ opertator and + operator is not working together.
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
main()
{
int x=20,y=35;
printf("1:%d%d\n",x,y);
x=y++ + x++; //This operation is not working
printf("2:%d%d\n",x,y);
y= ++y + ++x;
printf("3:%d%d\n",x,y);
}
If you compile the following program it gives following output.
gcc(3.3.2) - Wrong output
------------
1:2035
2:2136
3:2259
Ideal output should be
----------------------
1:2035
2:5636
3:5794
--
Summary: ++ opertator and + operator is not working together.
Product: gcc
Version: 3.3.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: asokumar at gmail dot com
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17095