Fixed #8657 (false postive: MISRA rule 15.7)

This commit is contained in:
Daniel Marjamäki 2019-08-11 17:54:02 +02:00
parent 6c55d27f19
commit 016340f77d
2 changed files with 5 additions and 0 deletions

View File

@ -1479,6 +1479,8 @@ class MisraChecker:
continue
if not simpleMatch(scope.bodyStart, '{ if ('):
continue
if scope.bodyStart.col > 0:
continue
tok = scope.bodyStart.next.next.link
if not simpleMatch(tok, ') {'):
continue

View File

@ -397,6 +397,9 @@ void misra_15_7() {
var2 = 10u;
} // no-warning
}
if (a==2) {} else if (b==4) {} // 15.7
if (a==2) {} else { if (b==4) {} } // no-warning
}
void misra_16_2() {