diff --git a/Makefile b/Makefile index f482051b8fa..c97ea02ffdb 100644 --- a/Makefile +++ b/Makefile @@ -136,7 +136,7 @@ ifeq (clang++, $(findstring clang++,$(CXX))) CPPCHK_GLIBCXX_DEBUG= endif ifndef CXXFLAGS - CXXFLAGS=-pedantic -Wall -Wextra -Wcast-qual -Wfloat-equal -Wmissing-declarations -Wmissing-format-attribute -Wno-long-long -Wpacked -Wredundant-decls -Wundef -Wno-shadow -Wno-missing-field-initializers -Wno-missing-braces -Wno-sign-compare -Wno-multichar -Woverloaded-virtual $(CPPCHK_GLIBCXX_DEBUG) -g + CXXFLAGS=-std=c++0x -O2 -DNDEBUG -Wall -Wno-sign-compare -Wno-multichar endif ifeq (g++, $(findstring g++,$(CXX))) @@ -366,7 +366,7 @@ dmake: tools/dmake/dmake.o cli/filelister.o $(libcppdir)/pathmatch.o $(libcppdir $(CXX) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) run-dmake: dmake - ./dmake + ./dmake --release clean: rm -f build/*.cpp build/*.o lib/*.o cli/*.o test/*.o tools/*.o externals/*/*.o testrunner dmake cppcheck cppcheck.exe cppcheck.1 diff --git a/cli/main.cpp b/cli/main.cpp index e0670f676f5..618bcbac4ab 100644 --- a/cli/main.cpp +++ b/cli/main.cpp @@ -20,7 +20,7 @@ /** * * @mainpage Cppcheck - * @version 2.13.99 + * @version 2.14.0 * * @section overview_sec Overview * Cppcheck is a simple tool for static analysis of C/C++ code. 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/lib/version.h b/lib/version.h index 73694725bfa..d99b949bd04 100644 --- a/lib/version.h +++ b/lib/version.h @@ -5,9 +5,9 @@ #define versionH #define CPPCHECK_MAJOR_VERSION 2 -#define CPPCHECK_MINOR_VERSION 13 +#define CPPCHECK_MINOR_VERSION 14 #define CPPCHECK_DEVMINOR_VERSION 14 -#define CPPCHECK_BUGFIX_VERSION 99 +#define CPPCHECK_BUGFIX_VERSION 0 #define STRINGIFY(x) STRING(x) #define STRING(VER) #VER diff --git a/man/manual.md b/man/manual.md index 421daf1112f..8b54efb88d9 100644 --- a/man/manual.md +++ b/man/manual.md @@ -1,6 +1,6 @@ --- title: Cppcheck manual -subtitle: Version 2.13.99 +subtitle: Version 2.14 author: Cppcheck team lang: en documentclass: report diff --git a/man/reference-cfg-format.md b/man/reference-cfg-format.md index 8c7d21285fe..110e5f99aeb 100644 --- a/man/reference-cfg-format.md +++ b/man/reference-cfg-format.md @@ -1,6 +1,6 @@ --- title: Cppcheck .cfg format -subtitle: Version 2.13.99 +subtitle: Version 2.14 author: Cppcheck team lang: en documentclass: report diff --git a/man/writing-addons.md b/man/writing-addons.md index acd1cf9de83..22a3b69019e 100644 --- a/man/writing-addons.md +++ b/man/writing-addons.md @@ -1,6 +1,6 @@ --- title: Writing addons -subtitle: Version 2.13.99 +subtitle: Version 2.14 author: Cppcheck team lang: en documentclass: report diff --git a/releasenotes.txt b/releasenotes.txt index 36174fd3aad..c76811fe922 100644 --- a/releasenotes.txt +++ b/releasenotes.txt @@ -1,31 +1,34 @@ Release Notes for Cppcheck 2.14 -New checks: -eraseIteratorOutOfBounds: warns when erase() is called on an iterator that is out of bounds -returnByReference: warns when a large class member is returned by value from a getter function +Summary: +- Fixed 23 "crash" tickets +- Fixed 69 "false positive" tickets +- Fixed 36 "improve check" tickets -Improved checking: -initializerList: warn if a member is used before it is initialized +New checks: +- eraseIteratorOutOfBounds: warns when erase() is called on an iterator that is out of bounds +- returnByReference: warns when a large class member is returned by value from a getter function GUI: -- +-Make it possible to suppress warnings in all files in a folder Changed interface: -- - -Deprecations: -- +- Fixed crash with '--rule-file=' if some data was missing. +- '--rule-file' will now bail out if a rule could not be added or a file contains unexpected data. +- Add option '--check-version', you can use it to pin the cppcheck version in a script. +- Added '--template=simple'. It is expands to '{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]' without any additional location details. +- Removed deprecated platform type 'Unspecified'. Please use 'unspecified' instead. +- Add --file-filter=- option that reads file filters from stdin. Added for a plugin. Other: - Added CMake option 'EXTERNALS_AS_SYSTEM' to treat external includes as 'SYSTEM' ones. - The minimum required compiler versions have been bumped to GCC 5.1 / Clang 3.5 / Visual Studio 2015 - The minimum required CMake version has been bumped to 3.5 - Using Visual Studio with CMake now checks if the CMake version is at least 3.13. This was always required but was not checked explicitly. -- Added '--template=simple'. It is expands to '{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]' without any additional location details. -- Removed deprecated platform type 'Unspecified'. Please use 'unspecified' instead. - Removed deprecated 'Makefile' option 'SRCDIR'. - Added CMake option 'DISALLOW_THREAD_EXECUTOR' to control the inclusion of the executor which performs the analysis within a thread of the main process. - Removed CMake option 'USE_THREADS' in favor of 'DISALLOW_THREAD_EXECUTOR'. -- Fixed crash with '--rule-file=' if some data was missing. -- '--rule-file' will now bail out if a rule could not be added or a file contains unexpected data. -- Add option '--check-version', you can use it to pin the cppcheck version in a script. +- misra-config will not be treated as a critical error anymore + +Safety critical: +- #12440 : Misra violations found but cppcheck exited with 0 even after specifying exit code 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': diff --git a/win_installer/productInfo.wxi b/win_installer/productInfo.wxi index 0d9a8fa70bb..870130db69e 100644 --- a/win_installer/productInfo.wxi +++ b/win_installer/productInfo.wxi @@ -1,8 +1,8 @@ - + - +