sizeof in 36-bits machines

Michael Meissner meissner at dg-rtp.dg.com
Sun Oct 15 02:50:43 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 ?
>  I know 4.5 is not valid, because pANSI states that the type of `sizeof' is
>  `size_t' (unsigned integral), but on the other hand 4 is too small and
>  5 too big.
>  Or is it simply impossible to make a compliant ANSI C compiler for such
>  machine/memory configuration ?

The above implementation is not legal ANSI C, since ANSI C (in the
environment section, I think, but I don't my a copy of the draft at
home) mandates that each object must be an integral number of bytes.
In the case of the DEC-10, you would use 9-bit bytes.
--

Michael Meissner, Data General.				If compiles where much
Uucp:		...!mcnc!rti!xyzzy!meissner		faster, when would we
Internet:	meissner at dg-rtp.DG.COM			have time for netnews?



More information about the Comp.std.c mailing list