null pointers of type JOKE* can't be dereferenced

bdm659 at csc.anu.oz bdm659 at csc.anu.oz
Sun Oct 29 07:27:12 AEST 1989


>From a recent too-hasty posting of mine:

>>    Section 3.3.9 (on pointer equality):
>>          "If two pointers to object or incomplete types compare equal,
>>           they point to the same object."
>
> Marv Rubinstein informs me that in the draft of Dec. 7 1988 it says
>         "If two pointers to object or incomplete
>          types are both null, they compare equal."
> Query:
>   Has the sentence from 3.3.9 in the ">>" section above been modified to avoid
> the contradiction?  (I quoted it from a posting of Bill Wells.  My copy of
> the draft is so old that it doesn't have it at all.)

I should have stayed in bed this morning.  The e-mail I received from Marv
quite clearly stated that the sentence I quoted above from 3.3.9 has been
expanded to include the possibility of null pointers, as well as pointers just
past the end of the same array.  In that case, it seems that many little
problems earlier drafts had concerning pointer comparison have been fixed.

In summary, the BEST answer to the question
"does (int*)0 != (int*)0 really follow from the two sentences I quoted?"  is
"who cares?  the standard doesn't say that any more."

I'm sorry if I misled anyone.
[Vanishes in a puff of smoke made from the burning of old drafts.]

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



More information about the Comp.std.c mailing list