C
Christian Christmann
Hi,
for this code
int main( void )
{
unsigned short a= 10;
a = (a <<= 1) ^ 4129; //warning concerns this line
return 0;
}
gcc issues the warning:
warning: operation on `a' may be undefined
The problem is "(a <<=1 )" before the XOR operator, but
why might this expression lead to undefined behavior?
Regards,
Chris
for this code
int main( void )
{
unsigned short a= 10;
a = (a <<= 1) ^ 4129; //warning concerns this line
return 0;
}
gcc issues the warning:
warning: operation on `a' may be undefined
The problem is "(a <<=1 )" before the XOR operator, but
why might this expression lead to undefined behavior?
Regards,
Chris