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: 2 additions & 0 deletions .github/workflows/CI-unixish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,8 @@ jobs:
./cppcheck --error-exitcode=1 --inline-suppr --addon=threadsafety addons/test/threadsafety
./cppcheck --error-exitcode=1 --inline-suppr --addon=threadsafety --std=c++03 addons/test/threadsafety
./cppcheck --error-exitcode=1 --inline-suppr --addon=misra addons/test/misra/crash*.c
./cppcheck --error-exitcode=1 --inline-suppr --addon=misra --enable=information addons/test/misra/config*.c

./cppcheck --addon=misra --enable=style --inline-suppr --enable=information --error-exitcode=1 addons/test/misra/misra-ctu-*-test.c
pushd addons/test
# We'll force C89 standard to enable an additional verification for
Expand Down
4 changes: 4 additions & 0 deletions addons/misra.py
Original file line number Diff line number Diff line change
Expand Up @@ -3315,6 +3315,10 @@ def misra_config(self, data):
continue
if isKeyword(tok.str) or isStdLibId(tok.str):
continue
if tok.astParent is None:
continue
if tok.astParent.str == "." and tok.astParent.valueType:
continue
self.report_config_error(tok, "Variable '%s' is unknown" % tok.str)

def misra_17_6(self, rawTokens):
Expand Down
10 changes: 10 additions & 0 deletions addons/test/misra/config1.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

struct S {
uint32_t some[100];
};

void foo( void )
{
if (((S *)0x8000)->some[0] != 0U) { }
}