Fixed #8704 (false postive: MISRA rule 5.2)

This commit is contained in:
Daniel Marjamäki 2018-10-07 17:19:40 +02:00
parent 39df519af9
commit d9e1cc957b
2 changed files with 4 additions and 2 deletions

View File

@ -635,7 +635,7 @@ class MisraChecker:
for variable2 in scopeVars[scope]["varlist"][i + 1:]: for variable2 in scopeVars[scope]["varlist"][i + 1:]:
if variable1.isArgument and variable2.isArgument: if variable1.isArgument and variable2.isArgument:
continue continue
if variable1.isExtern and variable2.isExtern: if variable1.isExtern or variable2.isExtern:
continue continue
if (variable1.nameToken.str[:31] == variable2.nameToken.str[:31] and if (variable1.nameToken.str[:31] == variable2.nameToken.str[:31] and
variable1.Id != variable2.Id): variable1.Id != variable2.Id):

View File

@ -25,7 +25,9 @@ typedef unsigned long long u64;
extern int misra_5_1_extern_var_hides_var_x; extern int misra_5_1_extern_var_hides_var_x;
extern int misra_5_1_extern_var_hides_var_y; //5.1 extern int misra_5_1_extern_var_hides_var_y; //5.1
extern int misra_5_2_var_hides_var______31x; extern const uint8_t misra_5_2_var1;
const uint8_t misra_5_2_var1 = 3; // no warning
static int misra_5_2_var_hides_var______31x;
static int misra_5_2_var_hides_var______31y;//5.2 static int misra_5_2_var_hides_var______31y;//5.2
static int misra_5_2_function_hides_var_31x; static int misra_5_2_function_hides_var_31x;
void misra_5_2_function_hides_var_31y(void) {}//5.2 void misra_5_2_function_hides_var_31y(void) {}//5.2