references to dereferenced null pointers

Henry Spencer henry at utzoo.uucp
Sun Mar 18 11:03:27 AEST 1990


In article <ROBERTO.90Mar16130444 at ecx1.ssd.csd.harris.com> shirono at ssd.csd.harris.com writes:
>	An integral constant expression with the value 0, or such an
>	expression cast to type void *, is called a _null pointer
>	constant_. (...)

Note, also, that the cast to `void *' is legal not because it somehow
creates a generic null pointer -- there is no such thing in C -- but
because there may not be an integer type of the same size as a pointer,
and breakage of old programs is minimized if NULL is the same size as
a pointer.  (Even on machines where pointers are not all the same size,
one can at least reduce the breakage somewhat this way.)
-- 
MSDOS, abbrev:  Maybe SomeDay |     Henry Spencer at U of Toronto Zoology
an Operating System.          | uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.std.c mailing list