lint, pointers, 0 (what else?)

km at cadre.UUCP km at cadre.UUCP
Fri Feb 8 07:42:53 AEST 1985


In article <366 at harvard.ARPA> breuel at harvard.UUCP writes:
>
>Finally, there is no good reason for not having
>sizeof(int)==sizeof(char *).  'int' is not guaranteed to be the fastest
>integer type around (speedof(int)<=speedof(short) on practically all
>machines...). And if you are worried about getting an efficient integer
>type portably, why don't you just use 'typedef short EfficientInt;' :-?
>
>K&R (quoting from my mind) calls 'int' the 'natural' choice for an
>integer data type on the target machine. In my opinion, the 'natural
>choice' is the size of a pointer (the largest pointer that is).
>

Indeed? And what about the 8086, or worse yet, 8088? A full pointer
is a 20 bit address which must be specified by a 32 bit value  (a
16 bit offset and 16 bit segment which overlap for all but 4 bits!).
Add to that the 8088, which has 16 bit registers but does transfers
8 bits at a time. What is the "natural" choice for an int on these
machines, and why should it have anything at all to do with their
pointer architecture?


Ken Mitchum
cadre.ARPA



More information about the Comp.lang.c mailing list