Hacker News new | ask | show | jobs
by jasomill 21 days ago
No. IIRC, you’re just not allowed to use a constant expression evaluating to 0 as a pointer to construct a non-null pointer to address zero.

Runtime pointer arithmetic resulting in a zero-valued pointer, is not a null pointer m, though it is also nonportable and could have the same effect (but hopefully not nasal demons, as I believe this falls under some catagory of nonportable behavior other than “undefined”).

There’s no requirement that the in-memory representation of a null pointer be all-zeroes, only that constant 0 represents a null pointer in source code.

Regardless, I agree that it’s a bizarre choice.