cppcheck --rule-file=rules.txt myfile.cpp 这将会检查myfile.cpp文件中所有的printf和scanf函数调用。 注意,cppcheck的规则是正则表达式,所以你可以使用正则表达式的所有功能来定义你的规则。例如,你可以使用.*来匹配任何字符,[a-z]来匹配任何小写字母,等等。 最后,cppcheck的规则检查是大小写敏感的,所以printf和...
安全性:Cppcheck 可以检测到一些常见的安全漏洞,如缓冲区错误、不当的访问控制、信息泄露等。 编码标准:Cppcheck 支持多种编码标准,包括 Misra C 2012、Misra C++ 2008、Cert C、Cert C++ 等。 其他检查:Cppcheck 还有许多其他的检查,具体可以参考这个链接。 4.3 检查器 开启检查器:--enable=关闭检查器:--disab...
Fix #13647: Misra C 21.6: Location should point at function call inste… 15天前 cfg Fix BOOST_REQUIRE false positives (#7341) 26天前 cli fixed #13518 - added command-line option--\{no-\}check-unused-templates(#7291) 8天前 cmake ...
"text": "-enable-pretty-printing", "ignoreFailures": true } ] }, { "name": "misra.py", "type": "python", "request": "launch", "program": "${workspaceFolder}/addons/misra.py", "console": "integratedTerminal", "args": [ "${workspaceFolder}/addons/test/misra/misra-test.c.dump...
"text": "-enable-pretty-printing", "ignoreFailures": true } ] }, { "name": "misra.py", "type": "python", "request": "launch", "program": "${workspaceFolder}/addons/misra.py", "console": "integratedTerminal", "args": [ "${workspaceFolder}/addons/test/misra/misra-test.c.dump...
rules 初始化。 3年前 snap 初始化。 3年前 tools 初始化。 3年前 valgrind 初始化。 3年前 win_installer 初始化。 3年前 .clang-tidy 初始化。 3年前 .codacy.yml 初始化。 3年前 .gitignore 1、代码优化。 3年前 .mailmap 初始化。 3年前 .travis.yml...
1. Using cppcheck I create the report (.xml) of a .cpp file with MISRA rules. 2. I created a project where my sonar-project.properties and my .cpp file (Descriptions.cpp) are located. 3. I have modified my .xml to “Generic issue import format” and now I have GenericFormat.xml...
g++ -o cppcheck -std=c++11 -lpcre -DHAVE_RULES -Ilib -Iexternals -Iexternals/simplecpp -Iexternals/tinyxml2 cli/*.cpp lib/*.cpp externals/simplecpp/simplecpp.cpp externals/tinyxml2/*.cpp MinGW mingw32-make If you encounter the following error withMATCHCOMPILER=yesyou need to specify yo...
"text": "-enable-pretty-printing", "ignoreFailures": true } ] }, { "name": "misra.py", "type": "python", "request": "launch", "program": "${workspaceFolder}/addons/misra.py", "console": "integratedTerminal", "args": [ "${workspaceFolder}/addons/test/misra/misra-test.c.dump...
"text": "-enable-pretty-printing", "ignoreFailures": true } ] }, { "name": "misra.py", "type": "python", "request": "launch", "program": "${workspaceFolder}/addons/misra.py", "console": "integratedTerminal", "args": [ "${workspaceFolder}/addons/test/misra/misra-test.c.dump...