2 ms·
This is a weak reason. In practice, machines that do not represent NULL as zero no longer exist and new designs of this nature would break so much existing cod
by loeg 8y ago
This is a weak reason. In practice, machines that do not represent NULL as zero no longer exist and new designs of this nature would break so much existing code, it would be difficult for them to gain wide adoption in the marketplace. The C standard hasn't decided to require NULL be represented as zero yet (and may never, to preserve compatibility with machines it used to have defined behavior on), but most C code runs on machines where NULL is represented with zero bits.
(You're absolutely correct that the standard does not require NULL be represented with zero bits, though.)
- saagarjha 8y agoI feel like a compiler is within its rights to optimize out that check if it so wishes, though.