As Amogh (categorically) and PHIfounder point out, the only fully portable types are _Bool , signed int and unsigned int . However, many compilers allow other integral types to combat bit-field packaging. In practice, bit fields are often used to represent device registers, where typically each bit or set of bits has its own meaning. The bit packing is dictated by 6.7.2.1 ad 11 standard C
An implementation can allocate any addressable storage block large enough to hold a bitfield. If there is enough space left, a bit field that immediately follows another bit field in the structure should be packed into adjacent bits of the same block. If there is not enough space, then whether a bit field that does not fit will fit in the next block or overlap adjacent units is determined by the implementation. The order of distribution of bit fields within a unit (from high order to low or low order) is determined by the implementation. The alignment of the storage address block is not indicated.
Many compilers have agreed that the “address storage unit” is of the type specified in the source. For example, the gcc compiler does not allow a 9-bit bit field of type unsigned char , but it does allow it for type unsigned int . In your examples, the gcc compiler for the Pentium structure using unsigned char will have a size of 1 byte, and the one that uses an unsigned int will be 4 bytes. Many compilers also agreed that if a bit field does not fit, it will not overlap with the next block. However, this can be applied using a bit field of width 0, which is defined by 6.7.2.1 ad 12 standard
Declaring a bit field without a declarator, but only a colon and a width, indicates an unnamed bit field. As a special case, an element of the structure of a bit field with a width of 0 indicates that the additional bit field should not be packed into the device in which the previous bit field was placed, if any.
If you mix bit fields with non-bit fields, then 6.7.2.1 ad 15 dictates that the address units of the bit fields and non-bit fields will have different addresses
Inside the structure object, the members of the non-bit field and the units in which the bit fields are located have addresses that increase in the order in which they are declared. A pointer to a structure object, appropriately transformed, points to its initial member (or if this element is a bit field, and then to the block in which it is located) and vice versa. There may be an unnamed addition to the structure object, but not at the beginning.
Some application architectures Binary interface (ABI) architectures provide the implementation of certain implementation options to ensure compatibility between different compilers for this architecture.