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

bdm659 at csc.anu.oz bdm659 at csc.anu.oz
Sat Oct 28 03:51:49 AEST 1989


In article <8952 at goofy.megatest.UUCP>, djones at 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 at anucsd.oz  or  bdm at anucsd.oz.au  (via uunet.uu.net)
                The address in the header may be scrambled.



More information about the Comp.std.c mailing list