Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!sdd.hp.com!wuarchive!udel!rochester!kodak!uupsi!fozzie!stanley From: stanley@phoenix.com (John Stanley) Newsgroups: comp.lang.c Subject: Re: the nil pointer is not zero (was TC 2.0 oddity - me or ?) Message-ID: <4kqLs10w163w@phoenix.com> Date: 14 Nov 90 01:13:26 GMT References: <27636@mimsy.umd.edu> Organization: One Man Brand Lines: 27 chris@mimsy.umd.edu (Chris Torek) writes: > In article s64421@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