Misra: Fix FP, rule 16.6

This commit is contained in:
Daniel Marjamäki 2017-04-17 09:07:45 +02:00
parent 196b530ede
commit 0adc4f0789
2 changed files with 8 additions and 0 deletions

View File

@ -226,6 +226,12 @@ void misra_16_6() {
default: default:
break; break;
} }
switch (x) {
case 1: {break;}
case 2: {break;}
default: {break;}
}
} }
void misra_16_7() { void misra_16_7() {

View File

@ -739,6 +739,8 @@ def misra_16_6(data):
count = count + 1 count = count + 1
elif tok.str == '{': elif tok.str == '{':
tok = tok.link tok = tok.link
if simpleMatch(tok.previous.previous,'break ;'):
count = count + 1
elif tok.str == '}': elif tok.str == '}':
break break
tok = tok.next tok = tok.next