sizeof in 36-bits machines
Alan J Rosenthal
flaps at dgp.toronto.edu
Fri Oct 13 09:20:33 AEST 1989
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 ?
...
>Or is it simply impossible to make a compliant ANSI C compiler for such
>machine/memory configuration ?
If your integers are 36 bits, you cannot choose 8 bits as a char size. On the
dec-10, the natural choice would be 36 bit ints and 9 bit chars. The byte
operations on the dec-10 make 9 bit and 8 bit chars equally easy, although the
native size of choice is 7 for packing reasons.
I think you'll find that word-addressed machines tend to have sophisticated
byte-grabbing operations which allow specification of the byte size.
ajr
More information about the Comp.std.c
mailing list