This is the mail archive of the
mailing list for the GCC project.
Re: A bit field's length
kum <firstname.lastname@example.org> writes:
> On a 32 bit platform,
> Is this structure legal?
> UINT64 part1 : 48;
> UINT64 part2 : 16;
gcc accepts that. It is not portable C--the C99 standard only
requires the compiler to support bitfields of type _Bool, int, or
> Do I have to tune the compiler to pack them into a single 64 bit
> While assigning some 32 bit value to Parts.part1, do I have to
> cast the r-value into UINT64?
No, the cast will happen automatically.