简体   繁体   English

cppcheck跳过.hpp文件

[英]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. 我有一个包含大量模板的项目,该项目使用的系统带有.h文件,带有函数声明#include具有相应的.hpp和函数定义。 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. 但是, cppcheck似乎无法解析.hpp文件,并且我看不到任何选项来更改其解析的文件扩展名。 How do people usually handle this? 人们通常如何处理?

It seems that one can not change the extension cppcheck is looking for when scanning a directory. 似乎无法更改在扫描目录时正在寻找的扩展名cppcheck。 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. 有一个包含所有*.hpp文件列表的文本文件,然后使用--file-list=<file>参数运行cppcheck。

  2. Run cppcheck for every *.hpp file directly, giving the filename on command line. 直接为每个*.hpp文件运行cppcheck,并在命令行中提供文件名。

  3. Create *.cpp files that include the include those *.hpp files so that cppcheck can find them. 创建包括这些*.hpp文件的*.cpp文件,以便cppcheck可以找到它们。 Those could be tests for your library. 这些可能是对您的库的测试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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