From 3732fc1ba49aafea133f05ebd7c121b87f7599ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Mon, 18 Dec 2023 15:12:44 +0100 Subject: [PATCH] fix --- cli/cppcheckexecutor.cpp | 2 +- lib/suppressions.cpp | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/cli/cppcheckexecutor.cpp b/cli/cppcheckexecutor.cpp index bc31f04728c2..e9dd62d54067 100644 --- a/cli/cppcheckexecutor.cpp +++ b/cli/cppcheckexecutor.cpp @@ -281,7 +281,7 @@ int CppCheckExecutor::check_internal(CppCheck& cppcheck) const cppcheck.tooManyConfigsError(emptyString,0U); } - if (false) // <- TODO: settings.safety + if (settings.severity.isEnabled(Severity::information)) // <- TODO: settings.safety mStdLogger->writeCheckersReport(); if (settings.xml) { diff --git a/lib/suppressions.cpp b/lib/suppressions.cpp index a0df728968d4..31dd435da581 100644 --- a/lib/suppressions.cpp +++ b/lib/suppressions.cpp @@ -35,6 +35,9 @@ #include "xml.h" +static const char ID_UNUSEDFUNCTION[] = "unusedFunction"; +static const char ID_CHECKERSREPORT[] = "checkersReport"; + Suppressions::ErrorMessage Suppressions::ErrorMessage::fromErrorMessage(const ::ErrorMessage &msg, const std::set ¯oNames) { Suppressions::ErrorMessage ret; @@ -455,9 +458,9 @@ std::list Suppressions::getUnmatchedLocalSuppressions continue; if (s.hash > 0) continue; - if (s.errorId == "checkersReport") + if (s.errorId == ID_CHECKERSREPORT) continue; - if (!unusedFunctionChecking && s.errorId == "unusedFunction") + if (!unusedFunctionChecking && s.errorId == ID_UNUSEDFUNCTION) continue; if (tmpFile.empty() || !s.isLocal() || s.fileName != tmpFile) continue; @@ -474,9 +477,9 @@ std::list Suppressions::getUnmatchedGlobalSuppression continue; if (s.hash > 0) continue; - if (!unusedFunctionChecking && s.errorId == "unusedFunction") + if (!unusedFunctionChecking && s.errorId == ID_UNUSEDFUNCTION) continue; - if (s.errorId == "checkersReport") + if (s.errorId == ID_CHECKERSREPORT) continue; if (s.isLocal()) continue;