Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 SMI; site sun.uucp Path: utzoo!watmath!clyde!burl!ulysses!allegra!oliveb!Glacier!decwrl!sun!guy From: guy@sun.uucp (Guy Harris) Newsgroups: net.lang.c Subject: Re: if (p) ... (a clarification) Message-ID: <2982@sun.uucp> Date: Sun, 10-Nov-85 18:07:29 EST Article-I.D.: sun.2982 Posted: Sun Nov 10 18:07:29 1985 Date-Received: Wed, 13-Nov-85 08:24:25 EST References: <2098@brl-tgr.ARPA> <916@celtics.UUCP> <2910@sun.uucp> <52@hadron.UUCP> Organization: Sun Microsystems, Inc. Lines: 23 > >The definition of the C language requires that NULL be ZERO (how many times > >do people have to be told this?). ... > > ...my memory tells me that 0 should convert to the NULL pointer, not > necessarily be it. True, but NULL isn't the null pointer any more than 0 is; NULL is just an alternate way of saying "0". Think of it as a comment; it doesn't tell the compiler anything, but it tells the human reader of the code something. NULL must be #defined to be 0 in a correct C implementation. Null pointers need not have the same bit pattern as 0 or 0L. > ...this issue has been DISCUSSED TO DEATH n times already. Please do > not respond. AMEN. There is only *ONE* correct response to the question "does the definition of the C language require that a null pointer have the same bit pattern as the integral value 0"; the answer is NO. If anybody disagrees, go back and read K&R and/or Harbison and Steele until you see why there is no reason for the answer to be YES; please don't waste your time, our time, and all the readership's time arguing the point. Guy Harris