Example: write a function without side effects except writing to a local array whose address is returned. The entire function disappears.
@twoscomplement Try:
char *foo(const char *a) {
char b[256]; memcpy(b,a,256); return b;
}
Watch the memcpy disappear.
-
-
@marcan42 The compiler can do whatever it likes with invalid input. Be thankful it didn't result in demons flying out of your nose :P -
@twoscomplement I know; I was trying to see whether it would optimize a particular detail out but cheated and got more than I bargained for.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.