diff --git a/addons/misra.py b/addons/misra.py index be3e0ed4e..2cced8d14 100755 --- a/addons/misra.py +++ b/addons/misra.py @@ -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): diff --git a/addons/test/misra/misra-test.cpp b/addons/test/misra/misra-test.cpp index 52c35a0fe..0aa9a0b9d 100644 --- a/addons/test/misra/misra-test.cpp +++ b/addons/test/misra/misra-test.cpp @@ -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; }