Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!sharkey!atanasoff!hascall From: hascall@atanasoff.cs.iastate.edu (John Hascall) Newsgroups: comp.lang.c Subject: Re: calloc (actually NULL =?= 0) Message-ID: <987@atanasoff.cs.iastate.edu> Date: 12 Apr 89 20:42:39 GMT References: <22842@shemp.CS.UCLA.EDU> <1428@auspex.auspex.com> Reply-To: hascall@atanasoff.cs.iastate.edu (John Hascall) Distribution: na Organization: Iowa State Univ. Computation Center Lines: 18 In article <1428@auspex.auspex.com> guy@auspex.auspex.com (Guy Harris) writes: >>According to Harbison + Steele's book, calloc returns a region of >>memory with all bits set to zero. They also point out that pointers >>I always thought a pointer consisting of zero bits is NULL. >Nope. No such guarantee was ever made by any C language spec. What about the following taken from K&R, Appendix A, section 7.14, "Assignment operator": [talking about assigning ints to/from pointers being "a bad thing"] ... However, it is guaranteed that assignment of the constant 0 to a pointer will produce a null pointer... John Hascall / ISU Comp Center