This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Is this a gcc bug?


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]