From ff130b93ac963a17fdb1868685a338e5bbe5aa2f Mon Sep 17 00:00:00 2001 From: firewave Date: Tue, 16 Jan 2024 16:34:16 +0100 Subject: [PATCH] CppCheck: only generate `CheckUnusedFunctions` fileinfo when `unusedFunction` is enabled --- lib/cppcheck.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index d2671ec92a5..861fd372989 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -1104,7 +1104,7 @@ void CppCheck::checkNormalTokens(const Tokenizer &tokenizer) } } - if (!mSettings.buildDir.empty()) { + if (mSettings.checks.isEnabled(Checks::unusedFunction) && !mSettings.buildDir.empty()) { unusedFunctionsChecker.parseTokens(tokenizer, tokenizer.list.getFiles().front().c_str(), mSettings); } if (mSettings.checks.isEnabled(Checks::unusedFunction) && @@ -1145,7 +1145,7 @@ void CppCheck::checkNormalTokens(const Tokenizer &tokenizer) } } - if (!mSettings.buildDir.empty()) { + if (mSettings.checks.isEnabled(Checks::unusedFunction) && !mSettings.buildDir.empty()) { mAnalyzerInformation.setFileInfo("CheckUnusedFunctions", unusedFunctionsChecker.analyzerInfo()); }