MISRA.FIELD.BIT.ENUMBit-field has enum type. MISRA-C++ Rule 9-6-3 (required): Bit-fields shall not have enum type.[Undefined DR 58] RationaleThe use of enum as a bit-field type is prohibited as ISO/IEC 14882:2003 [1] does not explicitly define the underlying representation as signed or unsigned. It is therefore not possible to determine the exact number of bits required to represent all values in the enumeration. Examplestruct S { AnEnumType n : 2; // Non-compliant }; |