Skip to content

Commit

Permalink
CppCheck: only generate CheckUnusedFunctions fileinfo when `unusedF…
Browse files Browse the repository at this point in the history
…unction` is enabled
  • Loading branch information
firewave committed Feb 12, 2024
1 parent 8602ed3 commit ff130b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/cppcheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) &&
Expand Down Expand Up @@ -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());
}

Expand Down

0 comments on commit ff130b9

Please sign in to comment.