Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positives on cppcheck - struct member unused #2

Closed
utopalex opened this issue Sep 7, 2016 · 1 comment
Closed

False positives on cppcheck - struct member unused #2

utopalex opened this issue Sep 7, 2016 · 1 comment

Comments

@utopalex
Copy link

utopalex commented Sep 7, 2016

Using gerrit-check, I get frequent false positives about struct members being unused, even though they are clearly being used in .cpp implementation files, and checking those files directly will not find an issue.
It turns out that the way check.py includes header files for passing to cppcheck is wrong.
In fact this is confirmed on http://stackoverflow.com/questions/36825903/cppcheck-claims-that-a-field-is-not-used-while-it-is-in-another-file

Header files should not be explicitly checked, but are implicitly checked.
Therefore check.py, line 28 should be changed to not include .h and .hpp files.

@sschuberth
Copy link
Contributor

Therefore check.py, line 28 should be changed to not include .h and .hpp files.

Doing that would also affect other tools than just cppcheck, so I've implemented this slightly differently in PR #3 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants