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 addons/misra.py
Original file line number Diff line number Diff line change
Expand Up @@ -1362,6 +1362,8 @@ def _save_ctu_summary_tagnames(self, dumpfile, cfg):
for scope in cfg.scopes:
if scope.className is None:
continue
if scope.className.startswith('Anonymous'):
continue
if scope.type not in ('Struct', 'Enum'):
continue
used = False
Expand Down
6 changes: 6 additions & 0 deletions addons/test/misra/misra-ctu-1-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ struct misra_5_7_violation_t {
};
static misra_5_7_violation_t misra_5_7_use_type_1;

// #11443 - FP
static struct
{ // no warning
uint16_t x;
} misra_5_7_false_positive_1;

// cppcheck-suppress misra-c2012-8.4
// cppcheck-suppress misra-c2012-5.8
int misra_5_8_var1;
Expand Down
6 changes: 6 additions & 0 deletions addons/test/misra/misra-ctu-2-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ struct misra_5_7_violation_t {
};
static misra_5_7_violation_t misra_5_7_use_type_2;

// #11443 - FP
static struct
{ // no warning
uint16_t x;
} misra_5_7_false_positive_2;

// cppcheck-suppress misra-c2012-5.8
static int misra_5_8_var1;
// cppcheck-suppress misra-c2012-8.4
Expand Down