From dc46e35a10517813cbff4a5acfe5348f5dc1571a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20St=C3=B6neberg?= Date: Sat, 20 Apr 2024 19:16:41 +0200 Subject: [PATCH] valueflow.cpp: issue a debug message about analysis of condition expressions being disabled (#6025) --- lib/valueflow.cpp | 7 +++++++ tools/donate_cpu_lib.py | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index a76642e3425..3fa962b2311 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)) { diff --git a/tools/donate_cpu_lib.py b/tools/donate_cpu_lib.py index a33161ba7d0..338e106b578 100644 --- a/tools/donate_cpu_lib.py +++ b/tools/donate_cpu_lib.py @@ -16,7 +16,7 @@ # Version scheme (MAJOR.MINOR.PATCH) should orientate on "Semantic Versioning" https://semver.org/ # Every change in this script should result in increasing the version number accordingly (exceptions may be cosmetic # changes) -CLIENT_VERSION = "1.3.56" +CLIENT_VERSION = "1.3.57" # Timeout for analysis with Cppcheck in seconds CPPCHECK_TIMEOUT = 30 * 60 @@ -450,7 +450,7 @@ def scan_package(cppcheck_path, source_path, libraries, capture_callstack=True, options += ' --check-level=' + check_level if debug_warnings: options += ' --check-library --debug-warnings --suppress=autoNoType --suppress=valueFlowBailout' \ - ' --suppress=bailoutUninitVar --suppress=symbolDatabaseWarning' + ' --suppress=bailoutUninitVar --suppress=symbolDatabaseWarning --suppress=normalCheckLevelConditionExpressions' options += ' -D__GNUC__ --platform=unix64' options_rp = options + ' -rp={}'.format(dir_to_scan) if __make_cmd == 'msbuild.exe':