misra.py: Fix 20.7 FP for struct members (#2624)
This will close Trac#9673
This commit is contained in:
parent
f7096a2232
commit
20b02bff30
|
@ -2314,7 +2314,7 @@ 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] == ' ':
|
||||
|
|
|
@ -1017,6 +1017,12 @@ 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
|
||||
|
||||
// Compliant: M is a structure member name, not an expression
|
||||
struct { int a; } struct_20_7_s;
|
||||
#define M_20_7_6(M) struct_20_7.M
|
||||
#define M_20_7_7(M) (struct_20_7).M
|
||||
|
||||
#define MUL(a ,b ) ( a * b ) // 20.7
|
||||
|
||||
#define M_20_10(a) (#a) // 20.10
|
||||
|
|
Loading…
Reference in New Issue