null pointers of type JOKE* can't be dereferenced

Doug Gwyn gwyn at smoke.BRL.MIL
Tue Oct 31 00:57:17 AEST 1989


In article <879.254a0ba0 at csc.anu.oz> bdm659 at csc.anu.oz writes:
>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."

There is another point worth making here.  The Standard must be
subjected to more than mere "linguistic analysis" in order to
understand what it is saying; there is a gestalt that must be
acquired, and it goes beyond the simple expansion of words in
terms of their definitions, just as concepts in general embody
much more than is found in their literal definitions.

For instance, although "(int*)0" does indeed have type "pointer
to int", it does not point to an int.  Moreover, no pointer of
type "void*" points to any datum having type "void"; there are
no void objects in C as specified by the Standard (despite
arguments from some of us that there should be).  Yet simple
elaboration of "pointer to X" might mislead one to think that
such a thing points to X.  These technical terms are used in
subtly tricky ways, and must be understood in the total context
of the language specification.



More information about the Comp.std.c mailing list