You&#x27;re right, sorry.  I should have looked up that specific example before using it, and used an example that fell under &quot;undefined&quot; behavior.<p>My point, though, was that the compiler doesn&#x27;t have to explicitly notice the program using undefined behavior and choose a behavior.  Rather, the compiler may simply not consider undefined behavior at all, act as though only defined behaviors can occur, and have undefined behavior be whatever happens due to the lack of explicit handling.  The compiler can emit code that handles the defined behavior, and whatever that code <i>happens</i> to do in other cases will be the compiler&#x27;s &quot;handling&quot; of undefined behavior.<p>Thus, making the compiler explicitly flag undefined behavior isn&#x27;t just a matter of finding all the places where the compiler explicitly handles undefined behavior and emitting a warning there.  It would require noticing everywhere the compiler simply doesn&#x27;t consider cases the spec doesn&#x27;t require it to consider.