Of course, since the input program is UB, it's perfectly valid to translate it like that.
-
-
Show this threadThanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
It kinda makes sense since it's the only valid initialization possible, and idempotent (so make neverCalled() a nop). But a segfault better.
-
Indeed, I can see how the compiler got there. But I kind of wish there was a C compiler that flatly refuses to build undefined code.
-
I can't edit the code on my phone :-( Any change if you explicitly initialize to zero? (I'd think not) Does gcc do the same?
-
Currently on my phone only too...
-
Telling clang to compile as C changes nothing, which is weird as I don't know what could call NeverCalled without static constructors.
-
I think the logic only collects all value setters, disregarding callability of setter sites.
-
But making the function static (no possibility of unseen callers) changes the tail call of system() to unconditional "crash me".
-
This might be a side effect of unreachable code elimination.
End of conversation
New conversation -
-
-
Sure, why not? ಠ_ಠ
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
nice :)
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
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.