type and size of bit-fields

Norman Diamond diamond at jit345.swstokyo.dec.com
Mon Mar 18 14:16:42 AEST 1991


In article <1991Mar18.004505.2293 at tkou02.enet.dec.com> diamond at jit345.enet@tkou02.enet.dec.com (Norman Diamond) writes:
>In article <12638 at adobe.UUCP> taft at adobe.COM writes:
>
>>What should be the interpretation of the following bit-field appearing in a
>>struct?
>>  int foo: 24;
>>...
>>In light of this, a possible work-around comes to mind:
>>  long int foo: 24;
>>Unfortunately, this violates the ANSI C standard, which states: "A bit-field
>>may have type int, unsigned int, or signed int" -- omitting long types.
>
>According to the Dec. 1988 draft,
>>may have type int, unsigned int, or signed int" -- omitting long types.
>was really:
>SHALL have ....
>
>If this was changed in the final version, then we get to play more games
>with the semantics of English.  If it was not changed, then quite clearly
>you cannot declare any bitfield longer than an int (in a conforming program),
>besides being limited to the size of the type-specifiers if you specified any.
>--
>Norman Diamond       diamond at tkov50.enet.dec.com
>If this were the company's opinion, I wouldn't be allowed to post it.

--
Norman Diamond       diamond at tkov50.enet.dec.com
If this were the company's opinion, I wouldn't be allowed to post it.



More information about the Comp.std.c mailing list