Skip to content

Commit 5e07528

Browse files
committed
Fixed #9505 (MISRA 20.7 check suggests code change that leads to invalid code)
1 parent 267bdc0 commit 5e07528

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

addons/misra.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1857,12 +1857,12 @@ def misra_20_7(self, data):
18571857

18581858
while pos1 >= 0 and exp[pos1] == ' ':
18591859
pos1 -= 1
1860-
if exp[pos1] not in '([#':
1860+
if exp[pos1] not in '([#,':
18611861
self.reportError(directive, 20, 7)
18621862
break
18631863
while pos2 < len(exp) and exp[pos2] == ' ':
18641864
pos2 += 1
1865-
if pos2 < len(exp) and exp[pos2] not in ')]#':
1865+
if pos2 < len(exp) and exp[pos2] not in ')]#,':
18661866
self.reportError(directive, 20, 7)
18671867
break
18681868

addons/test/misra/misra-test.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,7 @@ union misra_19_2 { }; // 19.2
755755
#define M_20_7_2(A,B) (1+AB+2) // no warning
756756
#define M_20_7_3(A) ((A)+A) // 20.7
757757
#define M_20_7_4(A) x##A // 20.10 this test was written to see there are not FPs
758+
#define M_20_7_5(A,B) f(A, B) // no warning
758759

759760
#define M_20_10(a) (#a) // 20.10
760761

0 commit comments

Comments
 (0)