Type sizes

David Keppel pardo at june.cs.washington.edu
Sun Aug 28 15:49:38 AEST 1988


I'd like to know if the numbers and the rationalle are correct.
If you have other personal favorites, be sure to send them to me :-).


type		pdp11	VAX	68000	Cray-2	Unisys 1100	80386

char		8	8	8	8	9		8
short		16	16	8/16	32/64	18		8/16
int		16	32	16/32	32/64	36		16/32
long		32	32	32	64/64	36		32
char*		16	32	32	64/64	72		16/32/48
int*		16	32	32	24/64	72		16/32/48
int(*)()	16	16	16/64	64	576		16/32/48

Some machines have more than one possible size for a given type.
This can depend both on the compiler and on various compile-time
flags.

The *size* of an object does not guarantee the *precision* of that
object.  In particular, the Cray-2 may use 64 bits to store an |int|,
but a |long| cast into an |int| and back to a |long| may be truncated
to 32 bits.

	;-D on  ( Clint "programmer" Eastwood:  "Port *this*! )  Pardo
-- 
		    pardo at cs.washington.edu
    {rutgers,cornell,ucsd,ubc-cs,tektronix}!uw-beaver!june!pardo



More information about the Comp.lang.c mailing list