This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Is this a gcc bug?
- To: gcc at gcc dot gnu dot org
- Subject: Is this a gcc bug?
- From: Uros Bizjak <uros at kss-loka dot si>
- Date: Thu, 11 Jan 2001 11:11:07 +0100 (CET)
Hello!
This code produces a strange result on Solaris 2.5.1 with gcc 2.8.1:
--cut here--
#include <stdio.h>
int main()
{
int x = 0;
int y = 5;
int z = 15;
printf ("%i, %i, %i, %i\n", x, x += y, x += 2, x += z);
return 0;
}
--cut here--
It displays "22, 5, 7, 22".
I would expect the result to be "0, 5, 7, 22".
Uros.