misra.py: Fix 5.3 FP (#2405)
* misra.py: Fix 5.3 FP This will close https://trac.cppcheck.net/ticket/9497 * fix names conflict * fix naming
This commit is contained in:
parent
79a2e61721
commit
bd6f236481
|
@ -921,8 +921,6 @@ class MisraChecker:
|
|||
continue
|
||||
if int(innerVar.nameToken.linenr) > int(outerVar.nameToken.linenr):
|
||||
self.reportError(innerVar.nameToken, 5, 3)
|
||||
else:
|
||||
self.reportError(outerVar.nameToken, 5, 3)
|
||||
outerScope = outerScope.nestedIn
|
||||
for scope in data.scopes:
|
||||
if scope.className and innerVar.nameToken.str[:num_sign_chars] == scope.className[:num_sign_chars]:
|
||||
|
|
|
@ -165,6 +165,16 @@ void misra_5_3_func1(void)
|
|||
}
|
||||
}
|
||||
void misra_5_3_enum_hidesfunction_31y(void) {} //5.3
|
||||
extern bar_5_3(int i);
|
||||
void f_5_3( void )
|
||||
{
|
||||
{
|
||||
int i;
|
||||
i = 42;
|
||||
bar_5_3(i);
|
||||
}
|
||||
int i; // no warning
|
||||
}
|
||||
|
||||
|
||||
#define misra_5_4_macro_hides_macro__31x 1
|
||||
|
|
Loading…
Reference in New Issue