Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!ubvax!vsi1!daver!award!scott From: scott@award.UUCP (Scott Smith) Newsgroups: comp.arch Subject: Re: Re: Re: null pointers (was: negative addresses) Message-ID: <743@award.UUCP> Date: 21 Jun 88 23:39:24 GMT References: <226@proxftl.UUCP> <3100003@hpmwtla.HP.COM> Reply-To: scott@award.UUCP (Scott Smith) Organization: Award Software, Inc. Los Gatos, CA Lines: 15 In article <3100003@hpmwtla.HP.COM> jeffa@hpmwtla.HP.COM (Jeff Aguilera) writes: >ANSI C is not C. Prototypes do not exist in C. Please show me where in >K&R that it states that "0" refers to the NULL pointer irrespective of the >pointer, why do some systems have #define NULL (-1) in stdio? Actually K&R does, p97: "C guarantees that no pointer that validly points at data will contain zero, so a return value of zero can be used to signal an abnormal event... We write NULL instead of zero, however, to indicate more clearly that this is a special value for a pointer." The reason some systems have #define NULL (-1) in stdio is becuase zero *can* be a pointer to valid data (as is the case in my micro). In this case, NULL is simply changed to be a value that can't be a valid pointer on that particular system. S. Smith