This turns out not to be the case.
Compilers have been known to remove exactly that sort of error checking code, as there was undefined behavior present.
It's a mess.
Compilers have been known to remove exactly that sort of error checking code, as there was undefined behavior present.
It's a mess.
What I meant is “we (as in) the c/c++ community (or rather the specification committee)” could tomorrow decide that, lets say, all null pointer dereferences should lead to program exit. Existence of UB is a choice.
There are many cases of UB that would be cheap to check, but there are many more that are incredibly expensive to check.