Path: utzoo!attcan!uunet!husc6!bbn!uwmcsd1!ig!agate!helios.ee.lbl.gov!nosc!ucsd!ucsdhub!hp-sdd!hplabs!hpda!hp-sde!hpcea!hpnmdla!hpsrli!darrylo
From: darrylo@hpsrli.HP.COM (Darryl Okahata)
Newsgroups: comp.arch
Subject: Re: Re: Re: null pointers (was: negative addresses)
Message-ID: <90001@hpsrli.HP.COM>
Date: 20 Jun 88 16:06:23 GMT
References: <226@proxftl.UUCP>
Organization: HP Network Measurements Div, Santa Rosa, CA
Lines: 35

In comp.arch, 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

Pages 97-98 of K&R, first edition:

     "We write NULL instead of zero, however, to indicate more clearly that
     this is a special value for a pointer.  In general, integers cannot
     meaningfully be assigned to pointer; zero is a special case."

For the second edition of K&R ("ANSI C"), a passage similar to the above
appears somewhere around page 102.

> underlying implementation.  Mr. Wells, if "0" does refer to the null
> pointer, why do some systems have #define NULL (-1) in stdio?  My 

     Personally, I think that ANY "C" compiler that does not assign 0 (or even
0L - yuk) to NULL is busted.  Using a compiler that defines NULL as (-1), try
porting any program that appears in comp.sources.*.  You'll find that it's a
nightmare, as almost ALL C programs make the assumption that NULL is 0.

     [ ... ]
> Jeff "still wondering when C will be as clean as Algol-68" Aguilera

     OK, this topic has been brought up for the N-th to the i-th time.  Time to
kill it.

     -- Darryl Okahata
	{hplabs!hpccc!, hpfcla!} hpsrla!darrylo
	CompuServe: 75206,3074

Disclaimer: the above is the author's personal opinion and is not the
opinion or policy of his employer or of the little green men that
have been following him all day.