I want the following code to print 11, but prints 12, except in the last case, where it prints 10.
x=5; x1=x+(x=6); printf("%d\n",x1);
x=5; x1=(x=x)+(x=6); printf("%d\n",x1);
x=5; x1=(x+0)+(x=6); printf("%d\n",x1);
x=5; x1=(x=5)+(x=6); printf("%d\n",x1);
x=5; x1=(x=6)+x; printf("%d\n",x1);
x=5; x1=(x=6)+(x=x); printf("%d\n",x1);
x=5; x1=(x=6)+(x+0); printf("%d\n",x1);
x=5; x1=(x=6)+(x=5); printf("%d\n",x1);
gcc says in every case: 'warning: operation on ‘x’ may be undefined'.
That's mean.
Bernhard
PS: There's no question, sorry. Thanks for your answers. :)
PPS: Actual code is:
while ( data-(data=read(adr)&(1<<6)) ) i++;
I'm waiting for bit 6 at adr to stop toggling.