Temporarily suppress Cppcheck false positives

This commit is contained in:
Daniel Marjamäki 2019-01-12 19:11:44 +01:00
parent 022259caf3
commit e6edd74099
4 changed files with 5 additions and 2 deletions

View File

@ -156,7 +156,7 @@ script:
- cd ../ - cd ../
# use same hack as for clang to work around cppchecks broken exit status with -j 2 ; create file, tee everything to the file and stdout, grep for errors in the file # use same hack as for clang to work around cppchecks broken exit status with -j 2 ; create file, tee everything to the file and stdout, grep for errors in the file
- touch /tmp/cppcheck.cppcheck - touch /tmp/cppcheck.cppcheck
- ${CPPCHECK} --error-exitcode=1 --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml/ -Icli --enable=style,performance,portability,warning,internal --exception-handling --suppressions-list=.travis_suppressions -itest/synthetic -iaddons -igui . -j 2 |& tee /tmp/cppcheck.cppcheck - ${CPPCHECK} --error-exitcode=1 --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml/ -Icli --enable=style,performance,portability,warning,internal --exception-handling --inline-suppr --suppressions-list=.travis_suppressions -itest/synthetic -iaddons -igui . -j 2 |& tee /tmp/cppcheck.cppcheck
# check gui with qt settings # check gui with qt settings
- ${CPPCHECK} --library=qt --error-exitcode=1 -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml/ -Icli --enable=style,performance,portability,warning,internal --exception-handling -j 2 gui --suppressions-list=.travis_suppressions -igui/test |& tee --append /tmp/cppcheck.cppcheck - ${CPPCHECK} --library=qt --error-exitcode=1 -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml/ -Icli --enable=style,performance,portability,warning,internal --exception-handling -j 2 gui --suppressions-list=.travis_suppressions -igui/test |& tee --append /tmp/cppcheck.cppcheck
- sh -c "! grep '^\[' /tmp/cppcheck.cppcheck" - sh -c "! grep '^\[' /tmp/cppcheck.cppcheck"

View File

@ -2413,6 +2413,7 @@ void CheckClass::pureVirtualFunctionCallInConstructorError(
for (const Token *tok : tokStack) for (const Token *tok : tokStack)
errorPath.emplace_back(tok, "Calling " + tok->str()); errorPath.emplace_back(tok, "Calling " + tok->str());
if (!errorPath.empty()) if (!errorPath.empty())
// cppcheck-suppress unreadVariable // FP
errorPath.back().second = purefuncname + " is a pure virtual method without body"; errorPath.back().second = purefuncname + " is a pure virtual method without body";
reportError(tokStack, Severity::warning, "pureVirtualCall", reportError(tokStack, Severity::warning, "pureVirtualCall",

View File

@ -213,6 +213,7 @@ void CTU::FileInfo::loadFromXml(const tinyxml2::XMLElement *xmlElement)
if (std::strcmp(e->Name(), "function-call") == 0) { if (std::strcmp(e->Name(), "function-call") == 0) {
FunctionCall functionCall; FunctionCall functionCall;
if (functionCall.loadFromXml(e)) if (functionCall.loadFromXml(e))
// cppcheck-suppress uninitStructMember // FP
functionCalls.push_back(functionCall); functionCalls.push_back(functionCall);
} else if (std::strcmp(e->Name(), "nested-call") == 0) { } else if (std::strcmp(e->Name(), "nested-call") == 0) {
NestedCall nestedCall; NestedCall nestedCall;

View File

@ -822,6 +822,7 @@ void Preprocessor::getErrorMessages(ErrorLogger *errorLogger, const Settings *se
{ {
Settings settings2(*settings); Settings settings2(*settings);
Preprocessor preprocessor(settings2, errorLogger); Preprocessor preprocessor(settings2, errorLogger);
// cppcheck-suppress unreadVariable // FP
settings2.checkConfiguration = true; settings2.checkConfiguration = true;
preprocessor.missingInclude(emptyString, 1, emptyString, UserHeader); preprocessor.missingInclude(emptyString, 1, emptyString, UserHeader);
preprocessor.missingInclude(emptyString, 1, emptyString, SystemHeader); preprocessor.missingInclude(emptyString, 1, emptyString, SystemHeader);