2 ms·
Undefined behavior does not enable optimizations. Rather, the compiler may conclude that something must be true, because the alternative would be undefined beha
by scott_s 10y ago
Undefined behavior does not enable optimizations. Rather, the compiler may conclude that something must be true, because the alternative would be undefined behavior. Then, it may make optimization decisions based on that thing being true, causing potentially mysterious errors if, in fact, that thing is not true because the programmer made a mistake.
It's also possible you're confusing undefined behavior with implementation defined behavior.