misra: enable more checks for misra c++ 2008 checking

This commit is contained in:
Daniel Marjamäki 2022-06-07 20:55:55 +02:00
parent ec13f5fe5c
commit 359f6b3680
2 changed files with 14 additions and 2 deletions

View File

@ -4209,7 +4209,19 @@ class MisraChecker:
:param args: Check function arguments
"""
if not self.isRuleGloballySuppressed(rule_num):
if (not self.is_cpp) or rule_num in (202,203,1901):
misra_cpp = (
202, # misra-c2012-2.3 : misra c++2008 0-1-9
203, # misra-c2012-2.3 : misra c++2008 0-1-5
402, # misra-c2012-4.2 : misra c++2008 2-3-1
701, # misra-c2012-7.1 : misra c++2008 2-3-1
702, # misra-c2012-7.2 : misra c++2008 2-13-2
1203, # misra-c2012-12.3 : misra c++2008 5-14-1
1204, # misra-c2012-12.4 : misra c++2008 5-18-1
1305, # misra-c2012-13.5 : misra c++2008 5-19-1
1702, # misra-c2012-17.2 : misra c++2008 7-5-4
1901) # misra-c2012-19.1 : misra c++2008 2-13-3
if (not self.is_cpp) or rule_num in misra_cpp:
check_function(*args)
def parseDump(self, dumpfile):

View File

@ -20,6 +20,6 @@ C2::C2(void) : f(NULL) {}
static void test_misra_21_1_crash(void)
{
auto misra_21_1_C a, b;
auto misra_21_1_C a, b; // 12.3
a = b;
}