misra.py: Fix false positive for rule 15.6 (#2631)
This commit is contained in:
parent
c0be64d694
commit
61926ed7c3
|
@ -1950,7 +1950,7 @@ class MisraChecker:
|
|||
if token.str.startswith('//') or token.str.startswith('/*'):
|
||||
continue
|
||||
state = 0
|
||||
if token.str != '{':
|
||||
if token.str not in ('{', '#'):
|
||||
self.reportError(tok1, 15, 6)
|
||||
|
||||
def misra_15_7(self, data):
|
||||
|
|
|
@ -739,6 +739,14 @@ void misra_15_6() {
|
|||
(void)0;
|
||||
#endif
|
||||
|
||||
#if A > 0x42
|
||||
if (true) {
|
||||
(void)0;
|
||||
}
|
||||
if (true)
|
||||
#endif
|
||||
{ (void)0; } // no-warning
|
||||
|
||||
do {} while (x<0); // no-warning
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue