Menu

Cppcheck header files

2024-08-28
2024-09-03
  • Raed KHOCHTALI

    Raed KHOCHTALI - 2024-08-28

    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.

     
  • Daniel Marjamäki

    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.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.