There is no standard way to allocate bitfields. Bitfield allocation varies from compiler to compiler, even for the same target. Using bitfields for access to I/O registers is non-portable and inefficient for the masking involved in unpacking individual fields. It is recommended that you use regular bit-and (&) or bit-or (|) operations for I/O port access.
The maximum width of bitfields depends on the backend in that plain int bitfields are signed (see HC(S)08 Backend for details). As stated in Kernighan and Ritchie's The C Programming Language, 2 nd ed., the use of bitfields is equivalent to using bit masks to which the operators &, |, ~, |=, or &= are applied. In fact, the Compiler translates bitfield operations to bit mask operations.
The topic covered here: