misra addon: handle [[fallthrough]] attribute
This commit is contained in:
parent
0d2171a553
commit
f10d170ad3
|
@ -809,6 +809,8 @@ def misra_16_3(rawTokens):
|
|||
elif token.str.startswith('/*') or token.str.startswith('//'):
|
||||
if 'fallthrough' in token.str.lower():
|
||||
state = 2
|
||||
elif simpleMatch(token, '[ [ fallthrough ] ] ;'):
|
||||
state = 1
|
||||
elif token.str == '{':
|
||||
state = 2
|
||||
elif token.str == 'case' and state != 2:
|
||||
|
|
|
@ -220,6 +220,12 @@ void misra_16_3() {
|
|||
// fallthrough
|
||||
case 5:
|
||||
break;
|
||||
case 7:
|
||||
a=3;
|
||||
[[fallthrough]];
|
||||
case 8:
|
||||
a=4;
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue