Fixed #8704 (false postive: MISRA rule 5.2)
This commit is contained in:
parent
39df519af9
commit
d9e1cc957b
|
@ -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):
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue