Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!purdue!decwrl!hplabs!hpda!hpcupt1!bla From: bla@hpcupt1.HP.COM (Brad Ahlf) Newsgroups: comp.lang.c Subject: Re: Type sizes Message-ID: <5940004@hpcupt1.HP.COM> Date: 29 Aug 88 23:48:36 GMT References: <5575@june.cs.washington.edu> Organization: Hewlett Packard, Cupertino Lines: 27 >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. You should also consider the required *alignment* of the different types on different machines. The same type with same size on different machines may differ in alignment. >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. The *size* of an object does not guarantee the alignment of that object either. The *size* of an object also does not guarantee the space needed within a structure, the *size* and *alignment* do.