Commit Graph

14899 Commits

Author SHA1 Message Date
chrchr-github 30397f0d53
Fix FP initializerList with static member (#5864) 2024-01-09 19:42:23 +01:00
chrchr-github 9fceba4fbc
Fix FP initializerList with base member (#5862) 2024-01-09 14:52:32 +01:00
chrchr-github c21166565f
Fix #12322 detect usage of partially-initialized object in constructor (#5851) 2024-01-09 12:28:22 +01:00
Oliver Stöneberg 08d754d536
ClangImport: avoid unchecked pointer dereferences (#5856)
The `Tokenizer` and `TokenList` objects which are passed around always
need to exist so pass them by reference.
2024-01-08 19:46:12 +01:00
Oliver Stöneberg 30ca8e11b5
moved `Language` from `settings.h` to `standards.h` (#5854) 2024-01-07 22:53:39 +01:00
Oliver Stöneberg bbd2b2aa83
cleaned up includes based on `include-what-you-use` (#5855) 2024-01-07 11:07:51 +01:00
Oliver Stöneberg 81700b481d
some `TokenList` cleanups (#5848) 2024-01-06 23:49:25 +01:00
chrchr-github fde7ea6d17
Fix #12321 FP doubleFree within lambda (#5844) 2024-01-05 22:20:21 +01:00
Oliver Stöneberg 44ed53319e
CppCheck: extracted clang-specific code from `check(const std::string&)` into separate method (#5842) 2024-01-05 22:02:37 +01:00
Oliver Stöneberg 42c3aebda9
AddonInfo: const-ified loading and improved errorhandling (#5834) 2024-01-05 15:01:02 +01:00
chrchr-github c7cd091a93
Fix #12141 debug: simplifyUsing: unmatched body end (#5620) 2024-01-05 14:11:41 +01:00
chrchr-github f9134a69d2
CheckLeakAutoVar: fix crash on unknown macro (#5836) 2024-01-05 13:24:01 +01:00
Oliver Stöneberg 957096417e
fixed some `modernize-use-auto` clean-tidy warnings (#4663) 2024-01-05 13:22:37 +01:00
Oliver Stöneberg 6ef3224bd4
fixed signatures of deleted `operator=` (#5831) 2024-01-05 11:12:30 +01:00
chrchr-github 1eee68f039
Fix FN deallocuse with function call (refs #11409) (#5822) 2024-01-04 22:10:24 +01:00
chrchr-github efa8a08407
Set main version to 2.13.99 (#5818) 2024-01-04 22:00:30 +01:00
chrchr-github f24c7fdae9
Fix #12311 FP duplInheritedMember for const overload (#5829) 2024-01-04 20:59:09 +01:00
chrchr-github 73187e6e12
Fix #11998 FN (regression): comparisonError (#5826) 2024-01-04 20:58:39 +01:00
chrchr-github 481d4578ab
Fix #12301 FP doubleFree with GTK functions (#5823) 2024-01-04 11:02:59 +01:00
Oliver Stöneberg dd869cf808
added CMake option `EXTERNALS_AS_SYSTEM` to treat external includes as `SYSTEM` ones (#5386)
Although these files are part of our repo changes are being done via
their original projects so it might make sense to treat these as system
includes for some people instead of local ones.

Co-authored-by: Daniel Marjamäki <daniel.marjamaki@gmail.com>
2024-01-03 11:05:32 +01:00
chrchr-github 8d64d12e5d
Fix #12252 Regression: constParameterPointer (#5819) 2024-01-02 20:07:35 +01:00
chrchr-github d9d23d979d
Partial fix for #12302 internalAstError using lambda (#5816) 2024-01-02 13:33:22 +01:00
Paul Fultz II 4d9e69e42c
Fix 11985: False positive: uninitvar (valueflow) (#5781) 2023-12-27 18:11:57 +01:00
thingsconnected 403e7f1f7d
lib/addoninfo.cpp: When loading a JSON addon, test 'script' key. (#5797)
In case a user accidentally uses a wrong JSON file (e.g. naming.json,
which is the config file for namingng.py), the code could give a
confusing exception. This happens when the key 'script' is not defined
as a string.

This is solved by testing the key for existence and type. In case
'script' is not a key or refers to a type other than a string, a clear
error is given, stating for example: 'Loading naming.json failed. script
must be set to a string value.'

The message is kept in line with other messages. Maybe it can be
clarified further, e.g. 'Loading naming.json failed. A key "script" must
be set with a string value referring to a Python script.' - in which
case the errors relating to other keys may also be clarified.
2023-12-25 05:49:17 +01:00
chrchr-github a7baf88d4f
Fix #12289 FN (regression): memory leak not shown when strcpy is used (#5809) 2023-12-24 14:42:07 +01:00
olabetskyi e553940e23
#12158: improve check: variableScope is not reported when there is el… (#5758)
variableScope is not reported when there is else if
2023-12-24 14:01:01 +01:00
chrchr-github 17ee4093fa
Fix #10905, #11665 FN deallocuse (#5751) 2023-12-23 11:31:27 +01:00
Paul Fultz II 7f0234e7d5
Fix 12032: False positive: uninitialized variable, flags with same value (#5754) 2023-12-23 10:57:40 +01:00
Paul Fultz II 77157a678a
Fix 12033: false negative: uninitialized data passed as const data to function (#5747) 2023-12-23 10:55:39 +01:00
Daniel Marjamäki 948f822943
2.13: Update copyright year [ci skip] (#5785) 2023-12-20 21:41:58 +01:00
Dirk Mueller 76695f6be2
Fix #12272 (removeContradiction() Avoid use-after-free on multiple remove) (#5707)
As reported in
https://sourceforge.net/p/cppcheck/discussion/general/thread/fa43fb8ab1/
removeContradiction() minValue/maxValue.remove(..) can access free'd
memory as it removes all matching values by iterating over the complete
list. Creating a full copy instead of a reference avoids this issue.

Signed-off-by: Dirk Müller <dirk@dmllr.de>
2023-12-19 20:44:22 +01:00
Daniel Marjamäki 49da3e3821
Fixed #12281 (IDE plugin integration is broken by checkers report) (#5779) 2023-12-19 15:55:29 +01:00
Daniel Marjamäki 5aa1710dd0
Fix #12071 (Add safety mode that makes cppcheck more strict about critical errors) (#5777) 2023-12-18 18:26:23 +01:00
Oliver Stöneberg aa7629d969
aligned and optimized unique error handling (#5280)
The handling in `CppCheck::reportErr()` and `Executor::hasToLog()` was
slightly different. I hope this can somehow be shared after the executor
reworking.

We were also using a very inappropriate container for the error list
which caused a lot of overhead.

`-D__GNUC__ --debug-warnings --template=daca2 --check-library -j2
../test/testsymboldatabase.cpp`

Clang 15
main process  `284,218,587` -> `175,691,241`
worker process `9,123,697,183` -> `8,951,903,360`
2023-12-17 21:59:06 +01:00
Daniel Marjamäki 2932ab7592
Revert "Fixed #12071 (suppressing critical error, no indication to user that analysis of file fails) (#5771)" (#5775)
This reverts commit 7c316fb76d.
2023-12-17 19:13:14 +01:00
Daniel Marjamäki 7c316fb76d
Fixed #12071 (suppressing critical error, no indication to user that analysis of file fails) (#5771) 2023-12-17 15:42:17 +01:00
Oliver Stöneberg 086ceea333
fixed #12111 - memory leak with `-j2` and `--cppcheck-build-dir` (#5589) 2023-12-17 15:07:13 +01:00
Oliver Stöneberg f2622a673f
more cleanups in handling of ignored files (#5767) 2023-12-16 21:04:45 +01:00
Paul Fultz II ef27c29f27
Fix assertion failure in evalSameCondition (#5770) 2023-12-16 19:27:26 +01:00
chrchr-github 3329e2f633
Fix #11741 FP knownConditionTrueFalse minus/negation confuses check (#5766) 2023-12-16 17:03:56 +01:00
Oliver Stöneberg c79ec60bee
fixed #12264 - auto-detection of Python in Visual Studio built binaries when `python3.exe` does not exist (#5765)
I also suppressed the unwanted output from the `system()`.
2023-12-15 12:34:32 +01:00
chrchr-github 02fed7a266
Fix #12235 performance regression (hang) in 2.13dev (#5715)
Co-authored-by: chrchr-github <chrchr@github>
2023-12-15 11:01:08 +01:00
Oliver Stöneberg 61bbcbeeee
fixed #12108 - Crash in `CTU::FileInfo::getErrorPath()` with Clang-built binary (#5746)
This is actually just a workaround as it seems the issue is an upstream
Clang one.
2023-12-14 17:44:09 +01:00
olabetskyi 61127950b0
Fixed #12260 (false positive: unusedVariable with side effects in member initialization) (#5762)
revert old changes
2023-12-14 15:16:30 +01:00
Oliver Stöneberg d7835f199f
astutils.cpp: optimized `followAllReferences()` a bit (#5442)
Scanning `common/file.c` of the `xrdp` project with `--force --std=c11
--std=c++11 --inline-suppr --enable=warning`:

Clang 16 `4,208,373,435` -> `4,143,907,657`
Clang 16 (Boost) `3,837,285,621` -> `3,609,164,192`
GCC 13 `4,336,042,153` -> `4,331,137,034`
GCC 13 (Boost) `3,896,319,383` -> `3,795,013,995`
2023-12-13 21:08:22 +01:00
chrchr-github 8205b4a4b3
Fix #10572 FP nullPointerRedundantCheck with try/catch / #10701 FP knownConditionTrueFalse with nested try/catch (#5761) 2023-12-13 19:22:54 +01:00
chrchr-github b26b78b86d
Fix #12258 Assert failure in setSymbolic() (#5759) 2023-12-12 22:37:33 +01:00
chrchr-github 2c54f31bfe
Fix #12251 internalError while cppcheck tries to parse Clang AST (#5755) 2023-12-12 20:47:58 +01:00
chrchr-github 30e8814ecb
Fix #12255 Crash in executeMultiCondition() (#5752) 2023-12-11 17:15:21 +01:00
Daniel Marjamäki d695c6c766
Update tools/get_checkers.py and lib/checkers.cpp (#5749) 2023-12-11 15:18:19 +01:00