diff --git a/addons/misra.py b/addons/misra.py index 2208d9dc30e..f3ccd70cb0c 100755 --- a/addons/misra.py +++ b/addons/misra.py @@ -3335,7 +3335,7 @@ def misra_config(self, data): continue if not tok.isName: continue - if tok.function or tok.variable or tok.varId or tok.valueType: + if tok.function or tok.variable or tok.varId or tok.valueType or tok.typeScope: continue if tok.next.str == "(" or tok.str in ["EOF"]: continue diff --git a/addons/test/misra/misra-test.c b/addons/test/misra/misra-test.c index e8168ed5fda..7f8445615b0 100644 --- a/addons/test/misra/misra-test.c +++ b/addons/test/misra/misra-test.c @@ -1355,6 +1355,16 @@ static void misra_14_4(bool b) { if (z) {} //config } +// #12417 +struct bar_12417{ int a; }; +static int foo_12417(void){ + int ret = 1; + if (sizeof(struct bar_12417) == 0U){ // no warning for misra-config + ret = 0; + } + return ret; +} + static void misra_15_1(void) { goto a1; // 15.1 a1: