From ad8621ec5982ec19629e75550b2e2ac0590d683c Mon Sep 17 00:00:00 2001 From: firewave Date: Fri, 22 Mar 2024 20:42:01 +0100 Subject: [PATCH] valueflow.cpp: issue a debug message about analysis of condition expressions being disabled --- lib/valueflow.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index 9e7eed129ac..8765e901954 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -5379,7 +5379,14 @@ static const Scope* getLoopScope(const Token* tok) static void valueFlowConditionExpressions(const TokenList &tokenlist, const SymbolDatabase& symboldatabase, ErrorLogger &errorLogger, const Settings &settings) { if (!settings.daca && (settings.checkLevel == Settings::CheckLevel::normal)) + { + if (settings.debugwarnings) { + ErrorMessage::FileLocation loc(tokenlist.getSourceFilePath(), 0, 0); + const ErrorMessage errmsg({std::move(loc)}, tokenlist.getSourceFilePath(), Severity::debug, "Analysis of condition expressions is disabled. Use --check-level=exhaustive to enable it.", "normalCheckLevelConditionExpressions", Certainty::normal); + errorLogger.reportErr(errmsg); + } return; + } for (const Scope * scope : symboldatabase.functionScopes) { if (const Token* incompleteTok = findIncompleteVar(scope->bodyStart, scope->bodyEnd)) {