Battle fields must be declared with the type signed int , unsigned int or bool from <stdbool.h> . Other types may or may not be legal (depending on the platform), but be careful with the signature - plain int may be considered unsigned for the bit field.
However, this may be a hint to the compiler that the alignment of the struct should be 1, not sizeof(int) . And the compiler is allowed to take a char and assign it that meaning.
According to C99 6.7.2.1/9,
The bit field is interpreted as an integer with or without a signature, consisting of the specified number of bits. If a value of 0 or 1 is stored in a bit field with a non-zero width of type _Bool, the value of the bit field must be compared with the stored value.
and footnote:
As indicated in clause 6.7.2 above, if the actual specifier of type int or the name typedef is defined as int , then it is determined by the implementation whether the bit field is signed or unsigned.
source share