Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!mit-eddie!cybvax0!frog!celtics!roger From: roger@celtics.UUCP (Roger Klorese) Newsgroups: comp.lang.c Subject: Re: To comment 48: Xenix Message-ID: <1526@celtics.UUCP> Date: Wed, 6-May-87 15:00:30 EDT Article-I.D.: celtics.1526 Posted: Wed May 6 15:00:30 1987 Date-Received: Sat, 9-May-87 02:08:40 EDT References: <77200001@uiucdcsp> <6464@mimsy.UUCP> <641@cognos.UUCP> Reply-To: roger@celtics.UUCP (Roger Klorese) Organization: CELERITY (Northeast Area), Framingham, MA Lines: 23 In article <641@cognos.UUCP> jimp@cognos.UUCP (Jim Patterson) writes: >In article <6464@mimsy.UUCP> chris@mimsy.UUCP (Chris Torek) writes: >>>But I think that declaring: #define NULL (char *)0 >>>is expensive but will always do the trick for all models (small,large,huge) >> >>This is wrong: It will not always work. In fact, it will not work >>on at least two existing machines, both of which have C compilers. > >I've no experience on PRIME... Well, I DO... let's talk about it. The Prime 50 series uses a segmented architecture. The null pointer is defined as a pointer to segment 7777(octal), location 0. NULL must be defined as 0, NOT (char *)0, for the compiler and runime environment to test this properly. By the way, character pointers are indeed a 48-bit quantity, containing segment number, protection ring, location (word), and byte-offset. -- ///==\\ (No disclaimer - nobody's listening anyway.) /// Roger B.A. Klorese, CELERITY (Northeast Area) \\\ 40 Speen St., Framingham, MA 01701 +1 617 872-1552 \\\==// celtics!roger@seismo.CSS.GOV - seismo!celtics!roger