Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!sdd.hp.com!think.com!mintaka!ai-lab!life!burley From: burley@mole.gnu.ai.mit.edu (Craig Burley) Newsgroups: comp.lang.c Subject: Re: NULL and 0 Message-ID: Date: 16 May 91 14:29:10 GMT References: <9105151906.AA22909@ucbvax.Berkeley.EDU> Sender: news@ai.mit.edu Organization: Free Software Foundation 545 Tech Square Cambridge, MA 02139 Lines: 16 In-reply-to: mccrady@torolab6.vnet.ibm.com's message of 15 May 91 19:08:02 GMT Another machine where NULL and 0 have different representations: The Prime 50 Series. Assuming they implemented C NULL pointers the way all the other languages did, NULL in C, which is "(char *) 0" or "(void *) 0", actually has a pointer value of 07777/0, where the first number is the (octal) segment number and the second is the word offset within the segment. It is possible that one or more C implementations under PRIMOS used 0/0 as NULL instead of 07777/0, but that'd probably be only to deal with old C code that assumed that on all machines a NULL pointer had the same binary representation as integer 0. I'd be very surprised if the "official" or standard way to compile C code under PRIMOS wasn't to use the 07777/0 representation for NULL, since other languages (PL/I for example) use that representation, as do libraries and OS system calls. -- James Craig Burley, Software Craftsperson burley@gnu.ai.mit.edu