diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index 4c3bcb7d0b69..cc85659a3de5 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -1635,9 +1635,8 @@ 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 = 1; - } + if (!mSettings.supprs.nofail.isSuppressed(errorMessage) && !mSettings.supprs.nomsg.isSuppressed(errorMessage)) + mExitCode = mSettings.exitCode; std::string remark; if (!msg.callStack.empty()) {