Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!uunet!munnari.oz.au!csc!bdm659 From: bdm659@csc.anu.oz Newsgroups: comp.std.c Subject: null pointers of type JOKE* can't be dereferenced Message-ID: <879.254a0ba0@csc.anu.oz> Date: 28 Oct 89 20:27:12 GMT References: <11380@smoke.BRL.MIL> <8952@goofy.megatest.UUCP> <872.254895b5@csc.anu.oz> <11432@smoke.BRL.MIL> <876.2549cbb7@csc.anu.oz> Organization: Computer Services, Australian National University Lines: 29 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@anucsd.oz or bdm@anucsd.oz.au (via uunet.uu.net)