3 ms·
Slightly tangential to the article but still important, it says "Some compilers infer that they can eliminate checks based on erroneous code elsewhere in the p
by tempguy9999 7y ago
Slightly tangential to the article but still important, it says
"Some compilers infer that they can eliminate checks based on erroneous code elsewhere in the program. For example, [obviously dodgy code snipped]some compilers will decide that ptr == NULL must always be false, since otherwise it would be incorrect to dereference it in call_fn()"
So why does the compiler not report this error, or better still reject the code outright? It seems to turn a compile-time-detected fatal error into a critically dangerous runtime error.