null pointers [joke?] (was: commom malloc/free practice ...)

David Adrien Tanguay datanguay at watmath.waterloo.edu
Sat Oct 28 08:19:27 AEST 1989


In article <872.254895b5 at csc.anu.oz> bdm659 at csc.anu.oz writes:
:    Section 3.2.2.3 (on the result of casting 0 to a pointer type):
:
:          "Such a pointer, called a null pointer, is guaranteed not to
:           point to any object or function."
:
:    Section 3.3.9 (on pointer equality):
:
:          "If two pointers to object or incomplete types compare equal,
:           they point to the same object."
:
:From these two rules, it logically follows that  (int*)0 != (int*)0 .

(int *) 0 is not a pointer to an object, so section 3.3.9 doesn't come
into play.

:Brendan McKay.  bdm at anucsd.oz  or  bdm at anucsd.oz.au  (via uunet.uu.net)

David Tanguay





More information about the Comp.std.c mailing list