sizeof in 36-bits machines

Doug Gwyn gwyn at smoke.BRL.MIL
Sat Oct 14 14:28:44 AEST 1989


In article <272 at ssp1.idca.tds.philips.nl> dolf at idca.tds.PHILIPS.nl (Dolf Grunbauer) writes:
>Assuming a 36-bit integer (e.g. DEC-10 :-) and 8-bit bytes, what should
>`sizeof(int)' return: 4, 4.5 or 5 ?

C requires that all data types have sizes that are integral multiples
of the size of a "char" (aka "byte").  This means that a 36-bit
implementation would have to make "char" 9, 12, 18, or 36 bits.
(The minimum allowed size is 8 bits, but 8 does not divide 36 evenly.)

I don't say that I LIKE this; I would have preferred permitting such
implementations to express sizeof in terms of bits, not bytes.  However,
that's what was officially decided.



More information about the Comp.std.c mailing list