I thought this was worth a bug report and it was the proper channel for it to be recorded in https://trac.cppcheck.net/ as I don't have an account there.
Is it possible to open a bug for this issue ?
Regards.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
cppcheck is reporting struct member as unused despite it being used in
offsetof():
cppcheck reports
struct-offsetof.c:4:8: style: struct member 'foobar::unused' is never used. [unusedStructMember]
char unused;
^
offsetof() macro is part of the language since C89 I believe.
Is it possible to extend cppcheck so that it has some knowledge of the
macro without parsing <stddef.h> ?</stddef.h>
Regards.
Hi,
I thought this was worth a bug report and it was the proper channel for it to be recorded in https://trac.cppcheck.net/ as I don't have an account there.
Is it possible to open a bug for this issue ?
Regards.
Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/13345
And it's already fixed ( https://github.com/danmar/cppcheck/pull/7041 ). Thanks a lot !