The value of a signed, 1-bit bit field is either 0, 1, or –1, depending on the compiler, architecture, optimization level, and so forth. Code that compares the value of a bit field to 1 may not work if the bit field is signed, so you will want to use unsigned 1-bit bit fields. Keep in mind that the order of bit fields in memory can be reversed between architectures.
For more information on issues related to endian format, see “Swapping Bytes.” See also “Archived Bit Fields” and “Structures and Unions.”
Last updated: 2007-02-26