🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #851

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

#851
From: bdm659
Date: Fri, 27 Oct 1989 17:51
25 lines
1358 bytes
In article <8952@goofy.megatest.UUCP>, djones@megatest.UUCP (Dave Jones) writes:
>
> 1. The sections concerning pointers are poorly written.
> It will not surprise me at all if a literal reading of them leaves some
> expected behavior unspecified.
>
> 2. It doesn't matter.

    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 .

Choose between  :-)  and  :-(  yourself.

==========================
Brendan McKay.  bdm@anucsd.oz  or  bdm@anucsd.oz.au  (via uunet.uu.net)
                The address in the header may be scrambled.
Technical Details
Message-ID: <872.254895b5@csc.anu.oz>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!uwm.edu!bionet!ames!uhccux!munnari.oz.au!csc!bdm659
References: <11380@smoke.BRL.MIL> <8952@goofy.megatest.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!uwm.edu!bionet!ames!uhccux!munnari.oz.au!csc!bdm659
From: bdm659@csc.anu.oz
Newsgroups: comp.std.c
Subject: null pointers [joke?] (was: commom malloc/free practice ...)
Message-ID: <872.254895b5@csc.anu.oz>
Date: 27 Oct 89 17:51:49 GMT
References: <11380@smoke.BRL.MIL> <8952@goofy.megatest.UUCP>
Organization: Computer Services, Australian National University
Lines: 25