我有一个驱动cppcheck坚果的代码片段,因为它没有看到日志调用中使用的变量。我无法计算出语法来抑制这两种情况,而且手册也没有用。分隔行、空格、逗号、冒号和分号都失败。单独的行给我“抑制不匹配”,其余的只是无效的: //cppcheck-suppress unreadVariableInvalid id &qu 浏览1提问于2015-02-16得票数
unreadVariable:lexilla/lexers/LexBaan.cxx variableScope:lexilla/lexers/LexBaan.cxx constParameterPointer:lexilla/lexers/LexBaan.cxx constParameterReference:lexilla/lexers/LexBash.cxx knownConditionTrueFalse:lexilla/lexers/LexBash.cxx variableScope:lexilla/lexers/LexBash.cxx constVariable:l...
Cppcheck认为,在程序集中存在“赋值但未使用”的“变量”负载。下面是一些违规行的例子。我可以在每一行之前关闭//cppcheck-禁止unreadVariable的消息,但是最好让cppcheck跳过整个内联组装部分。 我有没有办法做到这一点,或者我们只需要接受很多重复的评论?
CPPCHECK_OPTIONS += --suppress=selfAssignment CPPCHECK_OPTIONS += --suppress=integerOverflow CPPCHECK_OPTIONS += --suppress=variableScope CPPCHECK_OPTIONS += --suppress=unreadVariable CPPCHECK_OPTIONS += --suppress=knownConditionTrueFalse CPPCHECK_OPTIONS += --suppress=constParameter CPPCHECK_OPTION...
unreadVariable:samples/misc/samplesperformance.* // False positives returnDanglingLifetime:src/misc/iterator.h unreadVariable:tests/core/testreaders/testreaders.cpp unknownMacro:src/misc/aviation/altitude.h unknownMacro:src/misc/geo/coordinategeodetic.cpp ...
使用// cppcheck-suppress注释:你可以使用// cppcheck-suppress注释来告诉Cppcheck忽略特定的警告。 代码语言:javascript 复制 #include<iostream>#definePRINT_VAR(x)std::cout<<x<<std::endl;voidfoo(){int a=10;// cppcheck-suppress unusedVariablePRINT_VAR(a);} ...
cppcheck --enable=all --enable=information --inconclusive --error-exitcode=1 --suppress=missingIncludeSystem --suppress=unusedStructMember --suppress=unusedFunction --suppress=unknownMacro --inline-suppr --library=gtk --library=posix ./src 2> err.txt ...
因此,我得到了未使用的变量和范围缩减警告: if (LoadFromDatabase单独的行给我“抑制不匹配”,其余的只是无效的: //cppcheck-suppress 浏览1提问于2015-02-16得票数 5 回答已采纳 2回答 CppCheck忽略了宏定义中变量的使用,如何改变这一点? 在我的代码上运行CppCheck的输出显示以下错误:Variable 'strFullPath...
// Suppress everything in catch.hpp as won't be changing *:scintilla/test/unit/catch.hpp // Checks for moves move to variables that are not read but the moved from is checked unreadVariable:scintilla/test/unit/*.cxx accessMoved:scintilla/test/unit/*.cxx // cppcheck fails REQ...
注解忽略方法为: @edu.umd.cs.findbugs.annotations.SuppressFBWarnings( value = {"MT_CORR...