NULL pointers

mcdermot at unmvax.UUCP mcdermot at unmvax.UUCP
Sat Feb 9 15:57:20 AEST 1985


The recent discussion on NULL pointers having the value 0 brings to
mind a problem encountered in the days of Version 6: data was loaded
at location 0 sometimes (on a PDP-11/40).  If data can be at 0, then
0 can not be the null pointer if that data is to be referenced.  Our
solution was to make NULL be -1.  This always seemed to be better
than 0 (except that on most machines it means slightly longer code).

I haven't noticed the problem with any current software so I guess
the problem is solved (how?).
--john

-- 

John McDermott			{gatech|ucbvax|convex|pur-ee}!unmvax!mcdermot
Univ of NM			W (505) 277-4650 
Albuquerque, NM 87131		H (505) 255-7796

Merry Christmas from "The Land of Enchantment"



More information about the Comp.lang.c mailing list