Xref: utzoo comp.arch:4875 comp.lang.c:10201 Path: utzoo!attcan!uunet!husc6!think!ames!pasteur!ic.Berkeley.EDU!faustus From: faustus@ic.Berkeley.EDU (Wayne A. Christopher) Newsgroups: comp.arch,comp.lang.c Subject: Re: negative addresses Message-ID: <3504@pasteur.Berkeley.Edu> Date: 18 May 88 07:28:08 GMT References: <10001@tekecs.TEK.COM> <2393@uvacs.CS.VIRGINIA.EDU> <21541@amdcad.AMD.COM> <1988May12.162906.16901@utzoo.uucp> <7881@brl-smoke.ARPA> Sender: news@pasteur.Berkeley.Edu Lines: 15 In article <10001@tekecs.TEK.COM>, andrew@frip.gwd.tek.com (Andrew Klossner) writes: > >> Unfortunately, it is a real problem, because there are zillions of > >> programs that implicitly assume that [null] pointers are all-zeros. > > if (tbuf->c_ptr) The trick here is that whenever a pointer is converted into an integer (as here), the NULL pointer must be converted to the integer 0. It doesn't matter what the bit pattern is before conversion. Otherwise, as you say, the world would be swallowed up by huge tidal waves and the sun would fall from the sky. Are there any implementations of C that use a non-0 bit pattern? I pity the compiler writer... Wayne