Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!bionet!ames!hc!lll-winken!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: comp.lang.c Subject: Re: calloc Message-ID: <1428@auspex.auspex.com> Date: 12 Apr 89 17:45:06 GMT References: <22842@shemp.CS.UCLA.EDU> Reply-To: guy@auspex.auspex.com (Guy Harris) Distribution: na Organization: Auspex Systems, Santa Clara Lines: 15 >According to Harbison + Steele's book, calloc returns a region of >memory with all bits set to zero. They also point out that pointers >filled with zero bits do not necessarily have the value NULL, nor >do arithmetic values consisting of zero bits have necessarily have the value >zero. How can this be? Easy. Consider a machine where the architects, or implementors of languages available before C was made available, decided that a null pointer was, say, a bit pattern with the value 0xff000000. Now, in order to be compatible with those other languages, the implementors of C made the bit pattern for a null pointer 0xff000000 as well. >I always thought a pointer consisting of zero bits is NULL. Nope. No such guarantee was ever made by any C language spec.