Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!dciem!nrcaer!cognos!jimp From: jimp@cognos.uucp (Jim Patterson) Newsgroups: comp.lang.c Subject: Re: To comment 48: Xenix Message-ID: <641@cognos.UUCP> Date: Fri, 1-May-87 17:42:18 EDT Article-I.D.: cognos.641 Posted: Fri May 1 17:42:18 1987 Date-Received: Sat, 2-May-87 14:23:08 EDT References: <77200001@uiucdcsp> <6464@mimsy.UUCP> Reply-To: jimp@cognos.UUCP (Jim Patterson) Organization: Cognos Incorporated, Ottawa, Canada Lines: 23 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. >(DG MV series and PR1ME series have 48 bit char pointers, but 32 >bit word (integer, structure, &c) pointers.) I've no experience on PRIME, but I do know that the DG MV series uses 32 bit pointers exclusively (for both char and word pointers). They are represented differently (a char pointer is the corresponding word pointer shifted one bit left, with the low-order bit addressing one char of the corresponding word). However, the representation of NULL is the same, 0 in both cases. In fact, because an int is also 32 bits with DG's C compiler, there are very few reasonable ways of defining NULL that won't work over function calls (I think that all of the alternatives that have flown by this discussion would in fact work). -- Jim Patterson Cognos Inc.