More MISRA C++:2023 for MISRA Compliance Early Access

Hi there,

Following up on the launch of MISRA Compliance Early Access, I am very excited to announce that 30 additional MISRA C++:2023 are being released:

  • Rule M23_002 (0.0.2): Controlling expressions should not be invariant
  • Rule M23_025 (5.7.1): The character sequence ‘/*’ shall not be used within a C-style comment
  • Rule M23_035 (5.13.3): Octal constants shall not be used
  • Rule M23_065 (4.6.1): Operations on a memory location shall be sequenced appropriately
  • Rule M23_066 (8.0.1): Parentheses should be used to make the meaning of an expression appropriately explicit
  • Rule M23_092 (8.2.5): ‘reinterpret_cast’ shall not be used
  • Rule M23_097 (7.11.2): An array passed as a function argument shall not decay to a pointer
  • Rule M23_099 (8.3.1): The built-in unary ‘-’ operator should not be applied to an expression of unsigned type
  • Rule M23_101 (8.2.9): The operand to ‘typeid’ shall not be an expression of polymorphic class type
  • Rule M23_105 (8.19.1): The comma operator should not be used
  • Rule M23_107 (8.18.2): The result of an assignment operator should not be ‘used’
  • Rule M23_110 (9.3.1): The body of an ‘iteration-statement’ or a ‘selection-statement’ shall be a ‘compound-statement’
  • Rule M23_113 (9.4.2): The structure of a ‘switch’ statement shall be appropriate
  • Rule M23_151 (7.11.3): A conversion from function type to pointer-to-function type shall only occur in appropriate contexts
  • Rule M23_179 (6.4.3): A name that is present in a dependent base shall not be resolved by unqualified lookup
  • Rule M23_202 (18.5.2): Program-terminating functions should not be used
  • Rule M23_208 (19.2.3): The ‘’’ or ‘’’ or ‘' characters and the ‘/*’ or ‘’’ character sequences shall not occur in a ‘header file’ name
  • Rule M23_222 (25.5.3): The pointer returned by the C++ Standard Library functions ‘asctime’, ‘ctime’, ‘gmtime’, ‘localtime’, ‘localeconv’, ‘getenv’, ‘setlocale’ or ‘strerror’ must not be used following a subsequent call to the same function
  • Rule M23_226 (21.10.3): The facilities provided by the standard ‘header file’ ‘’ shall not be used
  • Rule M23_228 (30.0.1): The C Library input/output functions shall not be used
  • Rule M23_247 (10.2.1): An enumeration shall be defined with an explicit underlying type
  • Rule M23_278 (28.6.1): The argument to ‘std::move’ shall be a non-const ‘lvalue’
  • Rule M23_286 (23.11.1): The raw pointer constructors of ‘std::shared_ptr’ and ‘std::unique_ptr’ should not be used
  • Rule M23_369 (8.2.8): An ‘object pointer type’ shall not be cast to an integral type other than ‘std::uintptr_t’ or ‘std::intptr_t’
  • Rule M23_376 (7.0.3): The numerical value of a character shall not be used
  • Rule M23_377 (7.0.1): There shall be no conversion from type ‘bool’
  • Rule M23_378 (7.0.2): There shall be no conversion to type ‘bool’
  • Rule M23_386 (8.3.2): The built-in unary ‘+’ operator should not be used
  • Rule M23_398 (22.4.1): The literal value zero shall be the only value assigned to ‘errno’
  • Rule M23_408 (24.5.2): The C++ Standard Library functions ‘memcpy’, ‘memmove’ and ‘memcmp’ from ‘’ shall not be used

Together with the previously released rules, these 30 new rules will bring the MISRA C++:2023 rules count to 114 when the MISRA Compliance Early Access is enabled in SonarQube Server 2025 Release 3 Enterprise Edition. This amounts to a MISRA C++:2023 guidelines coverage of 64%.

Stay tuned, we’ll keep delivering at fast pace on this.

8 Likes