From ccc2abe4dd8f2bc7e9e45b4c4ef9f490bd78b078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Thu, 29 Aug 2024 16:24:15 +0200 Subject: [PATCH] test2 --- cli/cppcheckexecutor.cpp | 2 +- lib/cppcheck.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cli/cppcheckexecutor.cpp b/cli/cppcheckexecutor.cpp index a60e30405423..a39685f03f44 100644 --- a/cli/cppcheckexecutor.cpp +++ b/cli/cppcheckexecutor.cpp @@ -311,7 +311,7 @@ int CppCheckExecutor::check_internal(const Settings& settings) const stdLogger.reportErr(ErrorMessage::getXMLFooter()); } - if (settings.safety && (stdLogger.hasCriticalErrors() || returnValue != 0)) + if (settings.safety && stdLogger.hasCriticalErrors()) return EXIT_FAILURE; if (returnValue) diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index cc85659a3de5..4c3bcb7d0b69 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -1635,8 +1635,9 @@ void CppCheck::reportErr(const ErrorMessage &msg) if (!mSettings.buildDir.empty()) mAnalyzerInformation.reportErr(msg); - if (!mSettings.supprs.nofail.isSuppressed(errorMessage) && !mSettings.supprs.nomsg.isSuppressed(errorMessage)) - mExitCode = mSettings.exitCode; + if (!mSettings.supprs.nofail.isSuppressed(errorMessage) && !mSettings.supprs.nomsg.isSuppressed(errorMessage)) { + mExitCode = 1; + } std::string remark; if (!msg.callStack.empty()) {