How can I tell cppcheck to ignore certain errors?
-
11-03-2021 - |
Вопрос
i want to be able to write 2 sets of rules:
Ruleset which ignores errors like
- Uninitialized variable
- variableScope
Ruleset which includes ALL , but i can manually ignore one or more rule sets
Keeping in view that :
cppcheck will check for memory leaks. For classes the checking is only made if "--all" is given. The reason is that there will be false positives if an instance is deallocated automatically.
Решение
In Cppcheck terminology.. a rule is a user-defined pattern that Cppcheck should look out for in the code and report about.
1.Ruleset which ignores errors like
Use suppressions. See --suppression-list and --suppress. You can use -i to skip entire files.
2.Ruleset which includes ALL , but i can manually ignore one or more rule sets
Use --enable.
Не связан с StackOverflow