Hi there,
Yet another bulky batch of MISRA C++:2023 rules for the MISRA Compliance Early Access.
With the following 27 new rules, we are pushing the count from 114 rules to 141 rules.
- Rule M23_026 (Rule 5.7.2): Sections of code should not be “commented out”
- Rule M23_029 (Rule 6.4.1): A variable declared in an “inner scope” shall not hide a variable declared in an “outer scope”
- Rule M23_034 (Rule 5.13.1): Within character literals and non raw-string literals, "" shall only be used to form a defined escape sequence or universal character name
- Rule M23_037 (Rule 5.13.5): The lowercase form of “L” shall not be used as the first character in a literal suffix
- Rule M23_038 (Rule 5.13.7): String literals with different encoding prefixes shall not be concatenated
- Rule M23_050 (Rule 6.2.2): All “declarations” of a variable or function shall have the same type
- Rule M23_053 (Rule 6.2.3): The source code used to implement an “entity” shall appear only once
- Rule M23_096 (Rule 16.5.1): The logical AND and logical OR operators shall not be overloaded
- Rule M23_103 (Rule 8.14.1): The right-hand operand of a logical “&&” or “||” operator should not contain “persistent side effects”
- Rule M23_106 (Rule 8.20.1): An unsigned arithmetic operation with constant operands should not wrap
- Rule M23_125 (Rule 9.6.2): A “goto” statement shall reference a label in a surrounding block
- Rule M23_139 (Rule 10.4.1): The “asm” declaration shall not be used
- Rule M23_154 (Rule 11.6.3): Within an enumerator list, the value of an implicitly-specified “enumeration constant” shall be unique
- Rule M23_173 (Rule 15.1.3): Conversion operators and constructors that are callable with a single argument shall be “explicit”
- Rule M23_320 (Rule 5.13.2): Octal escape sequences, hexadecimal escape sequences and universal character names shall be terminated
- Rule M23_327 (Rule 8.2.11): An argument passed via ellipsis shall have an appropriate type
- Rule M23_341 (Rule 15.1.5): A class shall only define an “initializer-list constructor” when it is the only constructor
- Rule M23_351 (Rule 15.8.1): “User-provided” “copy assignment operators” and “move assignment operators” shall handle self-assignment
- Rule M23_365 (Rule 16.6.1): “Symmetrical operators” should only be implemented as non-member functions
- Rule M23_372 (Rule 15.0.1): “Special member functions” shall be provided appropriately
- Rule M23_379 (Rule 7.0.4): The operands of “bitwise operators” and “shift operators” shall be appropriate
- Rule M23_380 (Rule 7.0.5): “Integral promotion” and the “usual arithmetic conversions” shall not change the signedness or the “type category” of an operand
- Rule M23_381 (Rule 7.0.6): “Assignment” between numeric types shall be appropriate
- Rule M23_389 (Rule 9.5.2): A “for-range-initializer” shall contain at most one function call
- Rule M23_390 (Rule 9.5.1): “Legacy for statements” should be “simple”
- Rule M23_392 (Rule 5.10.1): User-defined identifiers shall have an appropriate form
- Rule M23_406 (Rule 0.3.1): Floating-point arithmetic should be used appropriately
The MISRA C++:2023 coverage is now of 79% and we keep pushing.
All these rules are available in SonarQube Server 2025 Release 4 Enterprise Edition and Data Center Edition.