I was using Cppcheck v2.13.0 and checking both .c and .h files. After upgrading to v2.14.1, Cppcheck started giving me unusedStructMember warnings for many structures.
This raises the question: Is it the correct approach to check only the .c files, or should I continue checking both the .c and .h files?
Thank you in advance for your answer.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It's more correct to check only the .c files. But provide include paths with -I so your .h files are included. unusedStructMember false positives are expected if you check .h files directly instead of including them.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I was using Cppcheck v2.13.0 and checking both .c and .h files. After upgrading to v2.14.1, Cppcheck started giving me unusedStructMember warnings for many structures.
This raises the question: Is it the correct approach to check only the .c files, or should I continue checking both the .c and .h files?
Thank you in advance for your answer.
It's more correct to check only the .c files. But provide include paths with
-I
so your .h files are included. unusedStructMember false positives are expected if you check .h files directly instead of including them.