Why would we want to pedwarn? As far as I can tell, the standard doesn't say this is ill-formed. 9.6 says,

"The value of the integral constant expression may be larger than the number of bits in the object representation (3.9) of the bit-field’s type; in such cases the extra bits are used as padding bits and do not participate in the value representation (3.9) of the bit-field."

and

"A bool value can successfully be stored in a bit-field of any nonzero size."

I'm sure that lots of users would complain about the compiler starting to reject bool bitfields of 2-8 bits.

I'm not opposed to warning about excessive size for bool and enum here, but the warning should be based on TYPE_SIZE rather than TYPE_PRECISION.

Jason

Reply via email to