# MISRA C++2023 inspired rules and improvements

**URL:** <https://community.sonarsource.com/t/misra-c-2023-inspired-rules-and-improvements/119508>\
**Category:** Sonar Updates\
**Tags:** cfamily, sonarqube-ide, sonarqube, sonarqube-cloud\
**Created:** [July 23, 2024, 8:13am UTC](https://community.sonarsource.com/t/misra-c-2023-inspired-rules-and-improvements/119508 "2024-07-23T08:13:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Geoffray](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/geoffray/32/2966_2.png) [@Geoffray](https://community.sonarsource.com/u/Geoffray)\
**Post date:** [July 23, 2024, 8:13am UTC](https://community.sonarsource.com/t/misra-c-2023-inspired-rules-and-improvements/119508/1 "2024-07-23T08:13:50Z")

</div>

We are happy to announce some improvements and additions to your C and C++ analysis.

We continued our effort taking inspiration from MISRA C++2023 to improve and align some of our rules with the latest best practices.  
The reworked rules are:

- [S824](https://rules.sonarsource.com/cpp/RSPEC-824): Functions should not be declared at block scope
- [S841](https://rules.sonarsource.com/cpp/RSPEC-841): “enum” members other than the first one should not be explicitly initialized unless all members are explicitly initialized
- [S955](https://rules.sonarsource.com/cpp/RSPEC-955): Non-standard characters should not occur in header file names in “#include” directives
- [S5259](https://rules.sonarsource.com/cpp/RSPEC-5259): Header guards should be followed by according “#define” macro
- [S6200](https://rules.sonarsource.com/cpp/RSPEC-6200): “volatile” should not be used to qualify objects for which the meaning is not defined

As part of this effort, you also have 3 more C++ rules:

- [S6991](https://rules.sonarsource.com/cpp/RSPEC-6991): Macro arguments should not contain preprocessing directives
- [S6994](https://rules.sonarsource.com/cpp/RSPEC-6994): “static\_assert” should be preferred to assert when the argument is a compile-time constant
- [S6996](https://rules.sonarsource.com/cpp/RSPEC-6996): A single L in a literal suffix should only be used for long values

All these will be available with SonarQube 10.7 starting from Developer Edition. They will be available shortly on [SonarCloud](https://sonarcloud.io/) and [soon on SonarLint](https://community.sonarsource.com/search?expanded=true&q=%23sl%3Asonarlint-releases%20tags%3Acfamily%20order%3Alatest_topic).

As always, you can see what’s coming next and vote for C and C++ features you would like to see in [SonarQube](https://portal.productboard.com/sonarsource/3-sonarqube/tabs/5-under-consideration), [SonarCloud](https://portal.productboard.com/sonarsource/1-sonarcloud/tabs/1-considering-feedback-wanted), and [SonarLint](https://portal.productboard.com/sonarsource/4-sonarlint/tabs/8-under-consideration).

Cheers
