Casting NULL again

holtz at sdcsvax.UUCP holtz at sdcsvax.UUCP
Thu Jan 29 07:30:47 AEST 1987



In article <12211 at sun.uucp> guy at 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 at sdcsvax.UCSD.EDU



More information about the Comp.lang.c mailing list