the nil pointer is not zero (was TC 2.0 oddity - me or ?)
John Stanley
stanley at phoenix.com
Wed Nov 14 12:13:26 AEST 1990
chris at mimsy.umd.edu (Chris Torek) writes:
> In article <s64421.658489804 at zeus> s64421 at zeus.usq.EDU.AU (house ron) writes:
> >Zero is actually a perfectly legitimate address, but it got snaffued
> >by C to stand for a NULL pointer.
>
> This is true in many *implementations*, but it is not part of C itself.
>
> On computers on which address location zero has `interesting' contents
> (e.g., a boot reset vector, or simply regular memory), implementations
> are faced with two choices: either the nil pointer pointer to some
And some operating systems will not map address 0 into the process
space, which makes 0 the NULL pointer, and dereferencing it immediately
painful. I remember reading that those systems which do not map 0
addresses are a direct result of protecting against the most common
invalid pointer reference.
<> "Aneth! That's a charming place!" "You've been to Aneth?"
<> "Yes, but not yet." -- The Doctor and Seth, "The Horns of Nimon".
><
<> "Sanity check!" "Sorry, we can't accept it, it's from out of state." - me
More information about the Comp.lang.c
mailing list