I'm running i386 -current of 13 May and ran into surprising behaviour
from gcc. Consider the following code snippet:
int i;
i = 1;
if (i += 1 == 2)
printf(%d; should be 2\n, i);
i = 1;
if ((i += 1) == 2)
printf(%d; should
On Tue, Jun 01, 2010 at 09:14:53PM +0200, Tim van der Molen wrote:
Would this be a bug in gcc or am I overlooking something?
== has a higher precendence than += and therefore binds stronger.
See operator(7).
Joerg
I'm running i386 -current of 13 May and ran into surprising behaviour
from gcc. Consider the following code snippet:
int i;
i = 1;
if (i += 1 == 2)
printf(%d; should be 2\n, i);
i = 1;
if ((i += 1) == 2)
printf(%d; should be
On Tue, Jun 01, 2010 at 09:14:53PM +0200, Tim van der Molen wrote:
I'm running i386 -current of 13 May and ran into surprising behaviour
from gcc. Consider the following code snippet:
int i;
i = 1;
if (i += 1 == 2)
printf(%d; should be 2\n, i);
i