Hello everyone,
Thank you to all who joined our webinar yesterday! Find below the questions that have been asked during the session:
Q: When was this new standard published?
A: MISRA C++2023 was published in October. It is already published: MISRA
You can also buy a hardcopy on Amazon
Q: Are there guidelines targeting C++20/23 using ranges, concepts, co-routines and modules?
A: MISRA C++2023 only focuses on C++17. The intent is to incorporate C++20 in the next versions.
Q: Can I leverage MISRA 2023 rules in the IDE with Sonar?
A: Yes! Misra C++ 2023 rules (C++ static code analysis | misra-c++2023) are available in flavors of SonarLint (Linter IDE Tool & Real-Time Software for Code | Sonar) that support C++. Some of these rules may not be turned on by default but will be if you use the “Mission Critical” Quality Profile on SonarQube/SonarCloud and bind your project to SonarLint using connected mode.
Q: Are you working on C++20? I know you just came up with MISRA-C++ 2023 based on C++17. C++20 is a very large update with many useful features.
A: While MISRA C++:2023 won’t cover C++20, this will come in a future version (probably just in time for people to start asking: are you working on C++23!)
Q: Did you use the recommendations in the book “Embracing Modern C++ Safely” when creating MISRA-C++ 2023?
A: [Andreas Weis] Not that I know of. It was published in 2022 when we were already in the process of finalizing the MISRA C++23 document, not of introducing new rules.
Q: Was the rationale for one return for debugging?
A: [Andreas Weis] Not really. The idea originally came from a time before structured programming was widespread and writing in assembler was more common. In that context, the rule makes a lot of sense in avoiding complex, hard-to-reason-about, control flows that hide a lot of bugs. Structured programming languages obviated the need for this rule to exist, and following it can often make code harder to read than the alternative.
Q: Is there tooling for checking MISRA standards?
A: Yes. There are different tools. Sonar provides some support for MISRA 2008 and are in the process of upgrading to MISRA C++2023
Q: MISRA 2008 rules are still active in SonarQube. Will they be replaced by MISRA 2023 soon?
A: Many rules are already available for Misra 2023 — you can find them tagged here: https://rules.sonarsource.com/cpp/tag/misra-c++2023/
Q: Is Sonar going to be a certified tool to check this MISRA standard?
A: While we recognize the benefits of having dedicated reporting for compliance teams and full coverage of MISRA, that’s not where we’re headed today.
Q: When will the next version of the MISRA standard be published?
A: [Andreas Weis] We are just starting to work on the next version, so it’s too early to commit to any schedule. There are talks about yearly updates.
Q: Are there plans to introduce something similar to MISRA for C# -like the Philips standard?
There is no such effort within MISRA, and I’m not aware of anything outside. But you might want to look at what rules Sonar provides for C#.