?BUG? Typedef struct in include
Qt Creator Cppcheck integration plugin
Brought to you by:
onemoregres
Struct is typedef'ed in .h include file. Variable is defined in main.cpp file. Plugin says for .h that "struct or union member" "is never used" despite of variable's fields are used in main.cpp, but cppcheck native application doesn't claim for this .h when checking entire directory. Is it a bug of plugin?
Hello!
Yes, cppcheck-gui doesn't check header files. Only sources. Just tested: it gives an error when i try to check types.h. It only checks (indirectly) header if it is included from source file.
Command-line tool cppcheck was able to find same warnings with "--enable=all" for both dir and file checks. So plugin's behavior looks explainable because it uses command-line tool. It checks both headers and sources independently.
Don't know why cppcheck's developers disabled headers checking (maybe too many false positives, or they suppose that only included headers should be checked or whatever), but plugin takes another approach (maybe wrong :) ).
I suppose the more warnings - the better (even if some of them are false). But its easy to make a header/source check switch if it will be a real problem.