Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
To answer one specific part of the question: Does this have anything to do with some systems allowing a different representation of the null pointer other than zero? Sort of. A null pointer ...
Answer
#1: Initial revision
To answer one specific part of the question: > Does this have anything to do with some systems allowing a different representation of the null pointer other than zero? Sort of. A null pointer constant is zero or zero cast to a `void *`, but that doesn't mean that a null pointer is necessarily represented by "all bits zero". If a null pointer is not "all bits zero", a compiler is obliged to recognize when it is being asked to assign a null pointer constant to a pointer variable, and assign the correct value. Similarly for comparisons. (I have actually used a machine where a null pointer was not "all bits zero" - Prime eventually gave up and added an instruction "is pointer C null" which meant "all bits zero or proper null pointer".)