Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site watmath.UUCP Path: utzoo!watmath!kpmartin From: kpmartin@watmath.UUCP (Kevin Martin) Newsgroups: net.lang.c Subject: Re: sizeof, ptrs, lint, portability Message-ID: <11406@watmath.UUCP> Date: Sat, 9-Feb-85 16:47:46 EST Article-I.D.: watmath.11406 Posted: Sat Feb 9 16:47:46 1985 Date-Received: Sun, 10-Feb-85 06:38:31 EST References: <8121@brl-tgr.ARPA> Reply-To: kpmartin@watmath.UUCP (Kevin Martin) Organization: U of Waterloo, Ontario Lines: 28 Summary: In article <8121@brl-tgr.ARPA> cottrell@nbs-vms.ARPA writes: >-) I apologize for calling (presumably someone's favorite) machines `weird' > or `braindamaged'. Let's say `less capable'. Let's say 'capable of doing things other than you want done'. I doubt that a pianist would like being called 'weird', 'braindamaged', or even 'less capable' just because you happen to want to hear her play a trombone. > Allowing any other value to actually be stored breaks this. Besides, > SHOW ME A C THAT USES ANYTHING OTHER THAN ZERO ON ANY MACHINE!!! > K&R says of pointer to integer conversions: "The mapping funxion is > also machine dependent, but is intended to be unsurprising to those > who know the machine." I would be surprised at nonzero null ptrs. Then you obviously don't know the machine. A Honeywell DPS8, running CP-6, uses the bit pattern 06014 (36 bits) as the null pointer (byte offset zero in segment number 014). The pointer to int casts (and back) are accomplished by ex-oring with this value. The value 0 CAN'T be used, since this is a valid pointer. >-) How many of you port what percentage of programs? I thought the > intent of the standard was to not break existing programs. I don't think it does break programs (except those which use =and initializers without the '='). Your programs will continue to run on systems on which they previously ran. You may get more warnings when you compile them, though. Kevin Martin, UofW Software Development Group