diff --git a/addons/misra.py b/addons/misra.py index 5e0a73763..e3af4bcd0 100755 --- a/addons/misra.py +++ b/addons/misra.py @@ -841,11 +841,11 @@ class Define: self.args = [] self.expansionList = '' - res = re.match(r'#define [A-Za-z0-9_]+\(([A-Za-z0-9_,]+)\)[ ]+(.*)', directive.str) + res = re.match(r'#define [A-Za-z0-9_]+\(([A-Za-z0-9_, ]+)\)[ ]+(.*)', directive.str) if res is None: return - self.args = res.group(1).split(',') + self.args = res.group(1).strip().split(',') self.expansionList = res.group(2) def __repr__(self): diff --git a/addons/test/misra/misra-test.c b/addons/test/misra/misra-test.c index 7ca1cc5ae..32eeb01e2 100644 --- a/addons/test/misra/misra-test.c +++ b/addons/test/misra/misra-test.c @@ -986,6 +986,7 @@ union misra_19_2 { }; // 19.2 #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 MUL(a ,b ) ( a * b ) // 20.7 #define M_20_10(a) (#a) // 20.10