From 5e07528af516ba646c478ba4f9a926ac3d64d572 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 14 Dec 2019 16:31:41 +0100 Subject: [PATCH] Fixed #9505 (MISRA 20.7 check suggests code change that leads to invalid code) --- addons/misra.py | 4 ++-- addons/test/misra/misra-test.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/misra.py b/addons/misra.py index 1220bf73a..9e051a7e9 100755 --- a/addons/misra.py +++ b/addons/misra.py @@ -1857,12 +1857,12 @@ class MisraChecker: while pos1 >= 0 and exp[pos1] == ' ': pos1 -= 1 - if exp[pos1] not in '([#': + if exp[pos1] not in '([#,': self.reportError(directive, 20, 7) break while pos2 < len(exp) and exp[pos2] == ' ': pos2 += 1 - if pos2 < len(exp) and exp[pos2] not in ')]#': + if pos2 < len(exp) and exp[pos2] not in ')]#,': self.reportError(directive, 20, 7) break diff --git a/addons/test/misra/misra-test.c b/addons/test/misra/misra-test.c index 2d6e52bb2..18b293d64 100644 --- a/addons/test/misra/misra-test.c +++ b/addons/test/misra/misra-test.c @@ -755,6 +755,7 @@ union misra_19_2 { }; // 19.2 #define M_20_7_2(A,B) (1+AB+2) // no warning #define M_20_7_3(A) ((A)+A) // 20.7 #define M_20_7_4(A) x##A // 20.10 this test was written to see there are not FPs +#define M_20_7_5(A,B) f(A, B) // no warning #define M_20_10(a) (#a) // 20.10