简体   繁体   中英

cppcheck skips .hpp files

I have a heavily templated project that is using the system of having a .h file with the function declarations #include a corresponding .hpp with the function definitions. However, cppcheck doesn't seem to parse the .hpp files, and I don't see an option to change the file extensions that it parses. How do people usually handle this?

It seems that one can not change the extension cppcheck is looking for when scanning a directory. There are some other options:

  1. Have a text file with a list of all your *.hpp files and run cppcheck with the --file-list=<file> parameter.

  2. Run cppcheck for every *.hpp file directly, giving the filename on command line.

  3. Create *.cpp files that include the include those *.hpp files so that cppcheck can find them. Those could be tests for your library.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM