我的專案結構非常復雜。它看起來像這樣:
App/
Inc/
Src/
OtherDir/
ManyOtherDirsInc/
ManyOtherDirsSrc/
OtherDirs/ThatAre/Inside/OtherDirs/Inc
build/
我正在使用帶有額外 compile_commands.json 的 CMake 構建它。
為了運行 CppCheck,我使用了運行此(大規模)命令的 VsCode 任務:
cppcheck --addon=${workspaceFolder}/misra.json
--cppcheck-build-dir=${workspaceFolder}/build
-D__GNUC__ --enable=warning,style,performance,portability,information
--suppress=missingIncludeSystem --suppress=unmatchedSuppression
--project=${workspaceFolder}/build/compile_commands.json
-i${workspaceFolder}/ParentFolderOfManyOtherDirs/WithOtherDirsInside
-i${workspaceFolder}/OtherDirs/ThatAlsoShouldBeRecursivelyIgnored
--quiet --template=gcc --verbose
這是否意味著 -i 不是遞回的?這會很奇怪,因為在添加檔案夾時,它們是遞回添加的。
我將非常感謝任何幫助。
uj5u.com熱心網友回復:
問題是 .h 檔案仍然被檢查,盡管有 -i 標志。解決方案:
--supress-lists=suppressions.txt
抑制.txt
*:/home/Projects/Full/Path/*
重要的提示!
抑制中的路徑必須是完整的,相對由于某種原因不起作用。對于有多個開發人員的專案來說,這有點問題。需要一些自動生成此檔案的腳本。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/343839.html
