3 ms·
1. No they don't. 2. The easiest ones to hit by accident are integer overflow ones followed by trapping floating point math. 3. Pointer aliasing is hard to hi
by AstralStorm 8y ago
1. No they don't.
2. The easiest ones to hit by accident are integer overflow ones followed by trapping floating point math.
3. Pointer aliasing is hard to hit if you're not baiting it.
4. Threading requires Data Race Free code. No language known validates this enough.
5. Unchecked pointer dereference and lifetime problems can be avoided especially in C++. It is a subset of missing input validation which again is not enforced in most programming languages.
6. Object slicing rarely comes into play on its own.
7. Format string mess also easy to avoid, s are weirdness caused by longjmp, signals and other ways of messing with the stack.
There are 193 UB cases in C99 and most of them are redundant and group able. Bunch of them can be called "programmer brain is out to lunch".
The list is bigger slightly in C20.