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('//'):
|
elif token.str.startswith('/*') or token.str.startswith('//'):
|
||||||
if 'fallthrough' in token.str.lower():
|
if 'fallthrough' in token.str.lower():
|
||||||
state = 2
|
state = 2
|
||||||
|
elif simpleMatch(token, '[ [ fallthrough ] ] ;'):
|
||||||
|
state = 1
|
||||||
elif token.str == '{':
|
elif token.str == '{':
|
||||||
state = 2
|
state = 2
|
||||||
elif token.str == 'case' and state != 2:
|
elif token.str == 'case' and state != 2:
|
||||||
|
|
|
@ -220,6 +220,12 @@ void misra_16_3() {
|
||||||
// fallthrough
|
// fallthrough
|
||||||
case 5:
|
case 5:
|
||||||
break;
|
break;
|
||||||
|
case 7:
|
||||||
|
a=3;
|
||||||
|
[[fallthrough]];
|
||||||
|
case 8:
|
||||||
|
a=4;
|
||||||
|
break;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue