Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

What will this C code do?

Name: Anonymous 2012-01-19 8:24

void main(){
int x=1;
printf("%d\n",x=2);
}

Name: Anonymous 2012-01-21 15:52

>>73
As a veteran assembly programmer, I expect this to work as expected:
float foo = xyzzy;
int bar = evil_bit_magic( *(int*)&foo );
foo = *(float*)&bar;


Oh and I expect compilers not to optimize out (x < x+1). If I'm doing the comparison, it's for a reason, I'm not just putting it there for fun. Sure, if you can prove that x will always be smaller than INT_MAX, go ahead and optimize it out, otherwise fuck off. But don't give me undefined behaviour.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List