Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!munnari.oz.au!csc!bdm659 From: bdm659@csc.anu.oz Newsgroups: comp.std.c Subject: Re: null pointers - I was wrong, but not for that reason. Message-ID: <878.2549e5f7@csc.anu.oz> Date: 28 Oct 89 17:46:30 GMT References: <11380@smoke.BRL.MIL> <8952@goofy.megatest.UUCP> <872.254895b5@csc.anu.oz> <30809@watmath.waterloo.edu> Organization: Computer Services, Australian National University Lines: 24 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.