Re:I Do Not Know C: Short quiz on undefined behavior (2015)
by vyodaiken on Tuesday February 14, 2017 @08:45AM
(#13643433)
I'm sorry, but that is not what the current standard, no matter its weaknesses, requires. The standard says that dereferencing a null pointer results in undefined behavior. The compiler writer chose to (a) deduce that the pointer dereference was not an oversight and (b) then produce a pointless "optimization" that compounded the error. Compiling the dereference to a move instruction is perfectly compatible with the standard.
[ Parent
| on HN ]
There are no comments on this comment yet.