Re:Null Pointer Dereferencing Causes Undefined Behavior
by kstenerud on Tuesday April 21, 2015 @10:56AM
(#9414436)
Most underlying implementations won't actually dereference here (which is why it usually works), but as far as the spec is concerned, you are dereferencing it, which is undefined.
That becomes a problem with modern optimizing compilers, because they make assumptions about your code based on what's allowed according to the spec.
That becomes a problem with modern optimizing compilers, because they make assumptions about your code based on what's allowed according to the spec.