3 ms·
The way to think about UB is that it’s like a false premise. Anything and everything can be derived from a false premise. Compilers can end up with arbitrarily
by layer8 4y ago
The way to think about UB is that it’s like a false premise. Anything and everything can be derived from a false premise. Compilers can end up with arbitrarily false conclusions if the program contains a false premise.
The other important thing to realize is that UB is generally a runtime condition and cannot be detected statically, in the general case. That’s usually why it’s been made UB in the first place.