Path: utzoo!attcan!uunet!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!swrinde!emory!hubcap!mephisto!mcnc!rti!dg-rtp!larrybud.rtp.dg.com!goudreau From: goudreau@larrybud.rtp.dg.com (Bob Goudreau) Newsgroups: comp.unix.wizards Subject: Re: What machines core dump on deref of NULL? Message-ID: <1990Jul2.153837.2293@dg-rtp.dg.com> Date: 2 Jul 90 15:38:37 GMT References: <2389@aix.aix.kingston.ibm.com> <13226@smoke.BRL.MIL> <26878337.172@tct.uucp> <413@minya.UUCP> Sender: usenet@dg-rtp.dg.com (Usenet Administration) Reply-To: goudreau@larrybud.rtp.dg.com (Bob Goudreau) Organization: Data General Corporation, Research Triangle Park, NC Lines: 33 In article <413@minya.UUCP>, jc@minya.UUCP (John Chambers) writes: > > > > We should NOT make engineering decisions based on > > perceived blame. Dereferencing null pointers is > > *illegal* and *non-portable*. > > Beg to differ, but C is widely used for writing embedded code (i.e., > code that runs standalone on a board with a processor, some memory, > and generally some other interesting hardware). The hardware always > insists that something particular be kept in low memory. The code > must be able to read (and often write) location zero, or it can't > possibly do its job correctly. This is as true of the typical Unix > kernel as it is of any other system. If a C compiler doesn't allow > dereferencing a null pointer, the applications that must do so due > to the hardware's requirements are rather crippled, or must be coded > partially in some other language. > > True, dereferencing a zero pointer is usually incorrect. But "usually" > and "always" aren't even nearly synonyms. Until we can get the hardware > designers to stop using address zero, we are stuck with the situation. You are confusing the C language's null pointer with a machine address whose bit pattern happens to be all zeros. These two concepts are *not* one and the same. For a thorough explanation of the null pointer, go read comp.lang.c's FAQ articles. ------------------------------------------------------------------------ Bob Goudreau +1 919 248 6231 Data General Corporation 62 Alexander Drive goudreau@dg-rtp.dg.com Research Triangle Park, NC 27709 ...!mcnc!rti!xyzzy!goudreau USA