Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!cbatt!ucbvax!sdcsvax!holtz From: holtz@sdcsvax.UUCP Newsgroups: comp.lang.c Subject: Re: Casting NULL again Message-ID: <2621@sdcsvax.UCSD.EDU> Date: Wed, 28-Jan-87 16:30:47 EST Article-I.D.: sdcsvax.2621 Posted: Wed Jan 28 16:30:47 1987 Date-Received: Thu, 29-Jan-87 06:46:06 EST References: <3859@brl-adm.ARPA> <12211@sun.uucp> Reply-To: holtz@sdcsvax.UCSD.EDU (Fred Holtz) Organization: U.C. San Diego Lines: 31 Summary: An example of a machine with unusual pointers In article <12211@sun.uucp> guy@sun.UUCP (Guy Harris) writes: > ... much deleted ... >No, I don't know of any machines offhand that are byte-addressible >(but why is this relevant? Do you think you'll never work on any >machine that isn't? I certainly wouldn't make that prediction about >myself...) and where pointers to different types of objects have >different representations (the size isn't the only characteristic of >the representation that's important). However, that's not an excuse >to drop the casts. The fact that something happens to work on the >machines you know about doesn't say anything about whether they'll >work on the machine you next have to deal with. I assume you meant 'are not byte-addressible' in the above. An example of such a machine is the CDC Cyber 700 series, which used a 60 bit word that was the only addressable entity. Packed into a word could be 10 6 bit characters or 5 12 bit chars (I know, YUCH!!). Pointers to char in such an environment are drastically different than pointers to int or float. Although I never used C on such a machine, Fortran 77's pass by reference on CHARACTER variables created such a monstrous piece of code that I could never again assume pointers to different objects were always the same... how would you like having to deal with a 60 bit pointer to a single 6 bit character from an assembler routine, where the lower 18 bits were the base address, the upper 18 bits the array offset (if any), then somewhere in between came the bit offset? The nightmares still linger... (but then that's what I get for using fortran) -- Fred Holtz holtz@sdcsvax.UCSD.EDU