Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site omen.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!houxm!vax135!cornell!uw-beaver!tektronix!reed!omen!caf From: caf@omen.UUCP (Chuck Forsberg WA7KGX) Newsgroups: net.unix-wizards Subject: Re: Xenix286 Wonders, Bugs, and Patches... Message-ID: <160@omen.UUCP> Date: Wed, 15-May-85 14:50:57 EDT Article-I.D.: omen.160 Posted: Wed May 15 14:50:57 1985 Date-Received: Fri, 17-May-85 00:16:11 EDT References: <10550@brl-tgr.ARPA> Organization: Omen Technology, Portland Lines: 29 >NULL is usually declared in stdio.h as: > #define NULL 0 >Kernighan & Ritchie on page 98 state explicitly that, "In general, integers >cannot meaningfully be assigned to pointers; zero is a special case." On the >previous page they state, "C guarantees that no pointer that validly points at >data will contain zero, ..." > >Thus, the code is not buggy in the least; with or without casting. If code >such as: > struct mumble *p; > ... > p = 0; >does not assign a 32-bit wide zero on a machine with 16-bit int's and 32-bit >pointers then you don't have a buggy program. You have a buggy compiler that >needs fixing. The problem is not a buggy compiler (Lord knows there are enough to go around in PC-AT Xenix) but the difficulty of transforming a sow's ear (8086 segmmented CPU) into a silk purse (32 bit CPU). Pushing an int onto the stack pushes 16 bits but a large model program is expecting to get a 32 bit magic cookie (pointer to char). Passing zero to a function is not as universal as assigning zero to something. -- Chuck Forsberg WA7KGX ..!tektronix!reed!omen!caf Omen Technology Inc 17505-V NW Sauvie IS RD Portland OR 97231 Voice: 503-621-3406 Modem: 503-621-3746 (Hit CR's for speed detect)