From 359f6b36809c8655de8060802002176e2554ba0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 7 Jun 2022 20:55:55 +0200 Subject: [PATCH] misra: enable more checks for misra c++ 2008 checking --- addons/misra.py | 14 +++++++++++++- addons/test/misra/misra-test.cpp | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) 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; }