Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions addons/misra.py
Original file line number Diff line number Diff line change
Expand Up @@ -921,8 +921,6 @@ def misra_5_3(self, data):
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]:
Expand Down
10 changes: 10 additions & 0 deletions addons/test/misra/misra-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down