20-12-2024, 02:21 PM
We don't wish to encourage the use of signed values in bitwise expressions, even if constant - so are not planning an exception.
We are assuming that FLAG_A etc. are C-style enums, so the code also violates 10.2.3 "The numeric value of an unscoped enumeration with no fixed underlying type shall not be used"
You need to deviate each such expression, or better define your own bitwise operator for this enum type (which will still need a deviation for 10.2.3 - but only in one place)
We are assuming that FLAG_A etc. are C-style enums, so the code also violates 10.2.3 "The numeric value of an unscoped enumeration with no fixed underlying type shall not be used"
You need to deviate each such expression, or better define your own bitwise operator for this enum type (which will still need a deviation for 10.2.3 - but only in one place)
Posted by and on behalf of
the MISRA C++ Working Group
the MISRA C++ Working Group