null pointers - I was wrong, but not for that reason.
bdm659 at csc.anu.oz
bdm659 at csc.anu.oz
Sun Oct 29 04:46:30 AEST 1989
>From my original posting:
> : 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 .
>From David Tanguay:
> (int *) 0 is not a pointer to an object, so section 3.3.9 doesn't come
> into play.
>From Joe English:
> [(A and B point to an object) and (A == B)] ==> [it is the same object].
> (1) (2) (3)
> If (1) is false it does not follow that (2) is false.
If the sentence is still exactly as I quote it, it only requires pointers to
object types, not pointers to objects. The difference is quite important.
(I'm learning, TWW.) See my reply to Doug Gwyn for a more detailed discussion,
and also the REAL reason why I WAS WRONG.
Brendan McKay.
More information about the Comp.std.c
mailing list