Commit Graph

1063 Commits

Author SHA1 Message Date
Daniel Marjamäki db155a59c1 Tokenizer: remove simplifyTokenList2 2022-07-18 16:20:36 +02:00
chrchr-github 21d992cc00
Fix crash on Windows with -j option (#4229)
* Fix crash on Windows with -j option

* Disable CI-cygwin workflow

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Try to fix Cygwin build

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Cygwin uses THREADING_MODEL_FORK

* Restore workflows

* Remove comment

* Fix dmake

* Fix #11179 FP invalidFunctionArgStr

* Revert "Fix #11179 FP invalidFunctionArgStr"

This reverts commit dd5d3e67c6.
2022-07-13 13:46:03 +02:00
Daniel Marjamäki fa5fd9cae0 Fixed #11172 (Unmatched suppression for inline suppression even though --suppress=unmatchedSuppression is used) 2022-07-12 22:51:26 +02:00
Oliver Stöneberg aea4fd1068
some `TestSuppressions` improvements and cleanups (#4271) 2022-07-12 17:36:36 +02:00
Oliver Stöneberg c9c1f83a69
use `emptyString` more consistently (#4034) 2022-07-10 10:57:29 +02:00
Oliver Stöneberg c36320747f
some `missingInclude`/`missingIncludeSystem` fixes and tests (#4027)
* do not emit `missingInclude` and `missingIncludeSystem` errors when not enabled / fixed and improved TestPreprocessor::inline_suppression_for_missing_include()

* testpreprocessor.cpp: added missing tests for `missingInclude` and `missingIncludeSystem`

* cppcheckexecutor.cpp: `missingIncludeSystem` was not emitted in normal analysis if `missingInclude` existed

* dmake

* added `run-dmake` as `testrunner` dependency
2022-07-09 23:21:11 +02:00
Oliver Stöneberg b51aea5531
separated process execution code into `ProcessExecutor` (#4249) 2022-07-08 16:42:57 +02:00
Daniel Marjamäki d1812c8022 Cppcheck: Write product name if provided in xml output 2022-07-07 17:35:13 +02:00
orbitcowboy 650f4099d2 Fixed wrong XML tree traversal when rules are parsed. 2022-06-22 08:46:48 +02:00
orbitcowboy 10c7c70970 Activated 'make validateRules' and improved rule XML file parsing. Now, it optionally accepts '<rules>...</rules>' tags to make xmllint happy. 2022-06-22 00:03:18 +02:00
PKEuS d20ea41325
Refactorization: Removed compatibility hacks for outdated or non-conformant compilers (#4186)
Merged from LCppC.
2022-06-08 15:16:01 +02:00
Oliver Stöneberg 412054e83a
enabled and mitigated `misc-unused-using-decls` clang-tidy warnings (#3543) 2022-06-04 16:39:25 +02:00
Oliver Stöneberg d36e05af28
enabled and fixed `modernize-use-emplace` clang-tidy warnings (#4165)
* enabled and fixed `modernize-use-emplace` clang-tidy warnings

* avoid unnecessary creation of temporaries in `emplace_back()` calls
2022-06-03 15:09:29 +02:00
Daniel Marjamäki 1f6554e2e8 Update copyright year 2022-05-21 12:18:27 +02:00
Martin Delille 6f597091a4
Handle exename on macos (#4071) 2022-05-08 13:57:42 +02:00
Oliver Stöneberg 5e6cc1053a
small `ErrorLogger` usage cleanups (#4033) 2022-04-21 21:30:22 +02:00
Oliver Stöneberg fdca61add9
aligned build options of Visual Studio project configurations and added them to CMake (#4020) 2022-04-21 21:28:29 +02:00
Oliver Stöneberg ce369c5122
added/adjusted --xml-version documentation (#4032) 2022-04-21 09:11:59 +02:00
Oliver Stöneberg 8f728cb4b6
added (partial) support for specifying C++23 and support more "-std" options (#3212) 2022-04-15 16:17:36 +02:00
Oliver Stöneberg 45158ec064
cleaned up includes based on include-what-you-use (#4007)
* cleaned up includes based on include-what-you-use

* updated translations
2022-04-13 12:24:00 +02:00
Oliver Stöneberg a98346bbe0
generate a program database in all Visual Studio configurations (#3996) 2022-04-11 11:28:07 +02:00
Daniel Marjamäki 8f386e15fd Remove bug hunting. This feature will be provided in Cppcheck premium. 2022-04-11 07:31:33 +02:00
Oliver Stöneberg 25ef9eeb26
use std::string::empty() (#3910) 2022-04-09 19:02:37 +02:00
Paul Fultz II dad10f2ab7
Fix 7684: ValueFlow: function call 'X::GetSize()' (#3984)
* Improve getting function to calculate the return

* Add test

* Format

* Move to cpp to avoid FP

* Format
2022-04-07 06:49:25 +02:00
Paul Fultz II 32ded1602b
Fix warnings in switch statements on clang (#3943) 2022-03-30 19:30:02 +02:00
Oliver Stöneberg 8bf8070923
fixed build with SmallVector (noExplicitConstructor warning and incorrect C++ standard for Visual Studio `*-PCRE` configuration) (#3937) 2022-03-28 21:40:44 +02:00
Daniel Marjamäki 4365704f14 cppcheck.cfg: support custom productname and about message 2022-03-24 22:44:47 +01:00
Daniel Marjamäki 1fe7cd348a exename: Set proper exename when cppcheck is executed from PATH and argv[0] does not contain path information 2022-03-21 18:35:53 +01:00
Daniel Marjamäki 10f93e31ef cli: in linux set proper exename value when cppcheck is executed from PATH and argv[0] does not have path information 2022-03-19 11:27:59 +01:00
Georgi D. Sotirov 33315b0ae5
Replace tinyxml2_LIBRARY with tinyxml2_LIBRARIES (#3897) 2022-03-15 21:17:03 +01:00
Oliver Stöneberg 0d336b868c
avoid some Clang compiler warnings (#3896) 2022-03-13 20:07:58 +01:00
Oliver Stöneberg de728f472c
removed ThreadExecutor::addFileContent() (#3865) 2022-03-02 11:10:29 +01:00
Oliver Stöneberg 51371f7929
added CMake option USE_THREADS to be able to use threads instead of fork() / cleanups (#3852) 2022-02-23 09:04:35 +01:00
Oliver Stöneberg b886b64b1a
de-coupled ErrorLogger interface from ThreadExecutor (#3849) 2022-02-22 09:54:35 +01:00
Oliver Stöneberg 12c1c081dc
run dmake and update Qt translation files on CMake build (#3820) 2022-02-16 07:06:59 +01:00
Oliver Stöneberg 6e57cc4323
small utils.h cleanup (#3821) 2022-02-11 19:44:08 +01:00
Oliver Stöneberg f32583e097
removed OVERRIDE and FINAL defines and use the keywords directly (#3767) 2022-02-10 23:02:24 +01:00
Oliver Stöneberg 974dd5d49f
only use bundled tinyxml2 in CMake when configured to do so (#3806) 2022-02-06 13:02:52 +01:00
Oliver Stöneberg a15a227b73
bumped minimum supported GCC version to 4.8 (#3768) 2022-02-05 17:57:32 +01:00
Daniel Marjamäki 631a9eefd2 2.7: Set versions 2022-02-05 12:17:54 +01:00
Daniel Marjamäki 3989408738 Update copyright year 2022-02-05 11:45:17 +01:00
Oliver Stöneberg 8f7770f512
added an include-what-you-use GitHub Action (#3759) 2022-02-01 17:19:19 +01:00
Oliver Stöneberg 171da2e6f9
avoid dependency on transitive includes - based on include-what-you-use (#3757) 2022-01-27 19:03:20 +01:00
Oliver Stöneberg a2a9c90142
added some missing copyright headers (#3758) 2022-01-26 19:02:20 +01:00
Oliver Stöneberg 55ff684f34
added unusedFunction self check to CI / cleanups (#3526) 2022-01-18 22:02:25 +01:00
orbitcowboy 9483ea4198 Fixed typo in CLI output. 2022-01-18 11:46:34 +01:00
Oliver Stöneberg cc24d6fcef
Fix #9162 (Invalid --project files do not give any error) (#3177) 2021-12-19 12:36:11 +01:00
Oliver Stöneberg ba402f3e50
cleaned up includes based on include-what-you-use (#3627) 2021-12-15 19:47:27 +01:00
Leon De Andrade 5b52f4946a
Implement support for passing multiple file filters (#3479) 2021-11-23 22:51:45 +01:00
Daniel Marjamäki ed4d2c21e6 Load cppcheck.cfg in FILESDIR if that is specified 2021-11-05 20:37:48 +01:00
Daniel Marjamäki b2f1a0aaa9 Loading cppcheck.cfg after --project to extend settings provided by project 2021-11-05 18:57:26 +01:00
Oliver Stöneberg 61a2b89034
streamlined message/error printing of CmdLineParser (#3524)
* cmdlineparser.cpp: removed message about deprecated --std=posix

* streamlined message/error printing of CmdLineParser

* test-helloworld.py: adjusted expected test result
2021-10-30 13:30:48 +02:00
Oliver Stöneberg b4704ba065
use target-specific configuration instead of global ones in CMake (#3534) 2021-10-30 09:08:07 +02:00
Daniel Marjamäki 872bd44c58 klocwork; CppCheckExecutor has dynamic memory and needs copy constructor and assignment operator 2021-10-28 16:33:15 +02:00
Oliver Stöneberg ba777b54d1
prevent uncaught exception in ThreadExecutor::handleRead() (#3514) 2021-10-20 20:41:42 +02:00
Daniel Marjamäki 0a5b7b2af5 Make it possible to configure default addons in a cppcheck.cfg file.
Example:
{
    "addons":["cert"]
}

With that cppcheck.cfg file cppcheck will always run the "cert" addon. Explicit options such as --addon=cert will not be needed.
2021-10-13 20:02:48 +02:00
DGarry82 e13eba86e5
use lowercase header filenames with MinGW toolchain (#3489) 2021-10-09 14:49:33 +02:00
Daniel Marjamäki 7684d7b98a 2.6 dev: set version 2021-10-02 13:15:12 +02:00
Ronald Hiemstra 2e682b1bf3
Update help text in cmdlineparser.cpp (#3464) 2021-09-22 20:06:42 +02:00
Daniel Marjamäki ca047e57bf Switch from http to https on our sourceforge webpage 2021-08-28 12:46:54 +02:00
chrchr-github d9b6940070
Cleanup: unnecessary includes, fix include order, fix unreferenced va… (#3418) 2021-08-26 19:36:31 +02:00
chrchr-github 5868d01e80
THREADING_MODEL_WIN: replace Win32 API calls with std::async, std::mutex (#3408) 2021-08-24 20:39:43 +02:00
chrchr-github 187d45a8df
THREADING_MODEL_WIN: Create a new CppCheck object for every file to be analysed in multi-thread mode. This fixes existing .a1 files not getting used due to changing hashes (caused by suppressions from previous files) and matches the behavior in THREADING_MODEL_FORK. (#3405) 2021-08-17 20:51:31 +02:00
Paul Fultz II 2a3657154b
Dont require __main__ for an addon (#3363) 2021-08-12 20:17:51 +02:00
Alfi Maulana aab5b39e2d
feat: add support for .ipp and .ixx extensions (#3383) 2021-08-09 10:46:56 +02:00
Paul Fultz II 7f358b2bed
Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
Lauri Nurmi 8869ee3554
Fix compilation with recent glibc where SIGSTKSZ is not constant. (#3378) 2021-08-04 07:45:50 +02:00
Coldfirex 3312a9f934
Add support for Haiku (#3342)
* Update cppcheckexecutor.cpp

* Update threadexecutor.cpp
2021-07-20 11:04:20 +02:00
chrchr-github 8cd8b9c64e
Fix MSVC build and some warnings (#3334) 2021-07-16 21:55:12 +02:00
vahtis 2abe07f279
Alternative macro for NAME_MAX on SunOs 11 (#3336)
Co-authored-by: vahtis <vahtis@iki.fi>
2021-07-14 20:50:14 +02:00
Paul Fultz II 8dc1fa7a59
Add colors to CLI reporting (#3304) 2021-07-08 21:21:35 +02:00
Daniel Marjamäki 3e3e9d8c50 2.5; Update versions 2021-07-04 08:40:41 +02:00
Daniel Marjamäki c489626167 updated copyright year 2021-07-04 08:09:11 +02:00
keinflue 6b8029633f
Fix build warnings and checkcfg errors with musl and libc++. (#3244)
* Fix musl include warning.

* Fix test/cfg errors with musl/libc++.

* Use correct C++ include for PR #3244

Co-authored-by: keinflue <>
2021-05-03 09:39:33 +02:00
Daniel Marjamäki d2d2124238 Revert "Clang import; This experimental feature didn't "take off" much. After a lot of work we are still far fram the goal. I remove it now but don't rule out completely that it could ever be added again."
This reverts commit 207361b174.
2021-04-30 16:47:02 +02:00
Daniel Marjamäki 207361b174 Clang import; This experimental feature didn't "take off" much. After a lot of work we are still far fram the goal. I remove it now but don't rule out completely that it could ever be added again. 2021-04-21 18:59:48 +02:00
Ken-Patrick Lehrmann 5768c3a726
Check stat return value in addFiles2 (#3214) 2021-04-18 21:52:14 +02:00
Daniel Marjamäki 93873be81a Cppcheck CLI; Better filtering of duplicate XML results when no -j is used 2021-04-05 20:09:45 +02:00
DGarry82 77716ee398
fix w64-mingw32-ld linking error (#3184)
* fix w64-mingw32-ld linking error

use shlwapi instead of Shlwapi.lib in mingw-w64 build environment
(prevents "/usr/bin/x86_64-w64-mingw32-ld: cannot find -lShlwapi" error)

* same MinGW shlwapi fix for {tests,tools}/CMakeLists.txt

Co-authored-by: Igor Rondarev <igor.rondarev@gmail.com>
2021-03-29 17:04:42 +02:00
Daniel Marjamäki cba0101df5 2.4: Set version 2021-03-21 21:25:54 +01:00
Daniel Marjamäki 42437277dc Update Copyright year 2021-03-21 20:58:32 +01:00
Daniel Marjamäki 3502036b14 Usability: Fixed loading of platform file placed in same path as project file 2021-03-05 08:39:09 +01:00
Daniel Marjamäki 849ea6b3c8 Fix compilation errors 2021-02-24 22:12:48 +01:00
PKEuS 141d2ac215 Refactorization: Improved internal implementation of severity and certainty levels
Backported from LCppC.
2021-02-24 22:00:06 +01:00
PKEuS cf1937294a Refactorization: Removed unnecessary \n and spaces in strings
Merged from LCppC.
2021-02-20 12:58:42 +01:00
Philipp Kloke ef82897af5 Refactorization: Use std::string::pop_back
Merged from LCppC.
2021-02-17 22:39:29 +01:00
YQGong b7ce2a5a99
fix NAME_MAX not found on macOS GCC8.1 (#3098) 2021-01-30 14:45:03 +01:00
Oliver Stöneberg 0df10c3cb5
enabled daca warnings in self-check (#3075) 2021-01-28 22:16:51 +01:00
Oliver Stöneberg c94713c607
improved error handling in ThreadExecutor (#3023) 2021-01-13 12:41:59 +01:00
Oliver Stöneberg 7c5015d54e
fixed --check-library not showing anything on its own (#3035) 2021-01-12 20:53:05 +01:00
Oliver Stöneberg ac7647fcd8
some self-check suppression cleanups (#3032) 2021-01-09 20:32:38 +01:00
Rikard Falkeborn bedf3118ef
library: Refactor to use enum class (#3026) 2021-01-08 10:29:01 +01:00
Oliver Stöneberg a7f0e91539
cppcheckexecutor.cpp: fixed stack-use-after-scope reported by ASAN (#3018) 2021-01-06 11:39:24 +01:00
Oliver Stöneberg 96704c9971
fixed and enabled some more clang-tidy warnings (#3007) 2021-01-05 17:51:32 +01:00
Oliver Stöneberg fbf5858f76
fixed and enabled several clang-tidy warnings (#2816) 2021-01-02 19:10:25 +01:00
Daniel Marjamäki e7c462b827 Refactoring; Avoid 'unsigned' 2020-12-27 21:05:31 +01:00
Oliver Stöneberg 0a1012a273
fixed and enabled -Wdocumentation and -Wdocumentation-pedantic clang warnings (#2819) 2020-12-27 09:15:59 +01:00
Oliver Stöneberg 9d57b832b8
fixed passedByValue warning hidden by suppression for false positive (#2974) 2020-12-24 20:09:11 +01:00
amai2012 f0da9098b9
Set language compatibility to C++14 in Visual Studio (#2967)
There is no C++11 flag
2020-12-22 10:24:25 +01:00
Daniel Marjamäki a493e17a6a Tweaks to use summaries in GUI 2020-12-19 20:46:00 +01:00