Quote Originally Posted by Sander View Post
Also, I'm not sure the compiler is allowed to optimize it away. Is it promised that the special case that p is NULL breaks?
Dereferencing NULL is undefined behavior, not a mandatory failing condition. So it could optimize it.