From e8a96932e1c751297560b0f150b659fc37b98330 Mon Sep 17 00:00:00 2001 From: Falital Date: Tue, 26 Apr 2022 17:39:39 +0200 Subject: [PATCH] Don't add suppressed errors to plist output (#4038) --- lib/cppcheck.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index 8abec31c8..1e08162ee 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -1542,7 +1542,9 @@ void CppCheck::reportErr(const ErrorMessage &msg) mErrorList.push_back(errmsg); mErrorLogger.reportErr(msg); - if (!mSettings.plistOutput.empty() && plistFile.is_open()) { + // check if plistOutput should be populated and the current output file is open and the error is not suppressed + if (!mSettings.plistOutput.empty() && plistFile.is_open() && !mSettings.nomsg.isSuppressed(errorMessage)) { + // add error to plist output file plistFile << ErrorLogger::plistData(msg); } }