4 ms·
Agreed. If the compiler wants to optimize something because of Undefined Behavior, that's something that -Wall should break on. 'Warning, you have undefined b
by mjevans 9y ago
Agreed. If the compiler wants to optimize something because of Undefined Behavior, that's something that -Wall should break on.
'Warning, you have undefined behavior', let the programmer decide what the intent of the section is and fix it.
- Sean1708 9y agoJust FYI, not all undefined behaviour can be detected at compile time using current C semantics. I'm very very in favour of cracking down on undefined behaviour and changing things from undefined to implementation-defined and stuff like that, but it's not as easy as just flicking a switch and making the compiler warn whenever it assumes undefined behaviour won't happen.