diff --git a/addons/misra.py b/addons/misra.py index ba22bb17e..f2bfbe458 100755 --- a/addons/misra.py +++ b/addons/misra.py @@ -1985,7 +1985,7 @@ class MisraChecker: continue if not is_source_file(func.token.file): continue - if func.token.file != func.tokenDef.file: + if func.token != func.tokenDef: continue if func.tokenDef.str == 'main': continue diff --git a/addons/test/misra/misra-test.c b/addons/test/misra/misra-test.c index 6c2bf1b7b..e0f031e11 100644 --- a/addons/test/misra/misra-test.c +++ b/addons/test/misra/misra-test.c @@ -391,6 +391,8 @@ static int misra_8_2_q (); // 8.2 void misra_8_4_foo(void) {} // 8.4 +extern void misra_8_4_func(void); +void misra_8_4_func(void) {} static void misra_8_4_bar(void) {} // Declared in header extern int16_t misra_8_4_count; // no-warning int16_t misra_8_4_count = 0; // Compliant