Added small subset of MISRA C++:2008 rules that can be checked using clang-tidy #17034
+12
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is to keep the discussion going that @Igor-Misic started this week, I was thinking we should first try to utilize free OSS to implement some basic MISRA rules checking, before considering commercial tooling.
This patch adds the
make misra-basic
target, that tests some Misra rules using clang-tidy.This can be extended by CppCheck as well, however CppCheck can't check on rule basis but generates an complete overview. But it's addons module does implement a nice set of Misra C rules see https://github.com/danmar/cppcheck/blob/main/addons/misra.py