diff --git a/addons/misra.py b/addons/misra.py index d817fd168..61caaadc6 100644 --- a/addons/misra.py +++ b/addons/misra.py @@ -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: diff --git a/addons/test/misra-test.c b/addons/test/misra-test.c index 528357caf..28a56e6fc 100644 --- a/addons/test/misra-test.c +++ b/addons/test/misra-test.c @@ -220,6 +220,12 @@ void misra_16_3() { // fallthrough case 5: break; + case 7: + a=3; + [[fallthrough]]; + case 8: + a=4; + break; default: break; } }