Cppcheck is triggering 5.8 for struct member with the same name as external identifier in a erratic manner (sometimes it throws the error, sometimes it doesn't)
structA{intsize;};externstructBsize;
Since the vars are in different namespaces this should be MISRA 5.8 compliant.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Cppcheck is triggering 5.8 for struct member with the same name as external identifier in a erratic manner (sometimes it throws the error, sometimes it doesn't)
Since the vars are in different namespaces this should be MISRA 5.8 compliant.
Sorry, I forgot to mention the CLI command
with
misra.json
beingSince the actual file structure is a bit complicated I tried to reproduce the behaviour in a pseudo code.
file_A.h
file_B.h
While
struct B
is defined infile_C.h
with the error coming up in the above mentioned lines.Please let me know if any info is missing. Thanks!
Last edit: Jan Joseph 2025-10-08