Commit Graph

12801 Commits

Author SHA1 Message Date
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 9118d330d3
Fix test failure on 32bit platform (#5803) 2023-12-23 20:59:59 +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 5a222b80a1
CI: fix --version tests (#5790) 2023-12-22 19:57:55 +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
olabetskyi 7191ed92b9
#12263: Constant Error 'missingInclude' (#5769)
Small adjustment of the log of the error.

- printed only when there was `--enabled=information` and no mentioning
of `missingInclude`
2023-12-16 18:38:30 +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 1135520aa8
run more tests in sanitizer workflows (#5744) 2023-12-16 17:03:03 +01:00
olabetskyi 42547aac9e
REOPENED #12260 (false positive: unusedVariable with side effects in member initialization) (#5764) 2023-12-15 11:35:55 +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 fcb41e2533
small cleanup of handling of ignored paths (#5757) 2023-12-14 16:55:42 +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
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
Paul Fultz II 243fa66bd3
Fix 12031: False positive: uninitialized variable (#5637) 2023-12-10 19:42:35 +01:00
chrchr-github 233e27b579
Add tests for #8399/#10646/#10833 (#5743) 2023-12-09 00:36:55 +01:00
Oliver Stöneberg 7452e681dd
fixed #12221 - de-duplicate input source files (regression) (#5740) 2023-12-08 22:17:22 +01:00
Daniel Marjamäki 1af83ad821
Fix #12091 (False negative: Uninitialized variable read in subfunction (regression)) (#5739) 2023-12-08 21:54:23 +01:00
chrchr-github f5109df632
Add tests for #9822/#9823 (#5742) 2023-12-08 21:20:10 +01:00
chrchr-github 1bdb7133e8
Fix #9684 New check: find unnecessary copy in range loop (#5738) 2023-12-08 16:58:43 +01:00
chrchr-github 7ac824f38a
Fix #12249 Assert failure in ExpressionAnalyzer (II) (#5733) 2023-12-08 14:46:20 +01:00
chrchr-github 77d8eaa2a1
Fix #12206 FN constParameterPointer with unknown const member (#5737) 2023-12-07 19:24:51 +01:00
chrchr-github 785c537ca2
Add tests for #4527, #10330 (#5734) 2023-12-07 12:16:53 +01:00
Oliver Stöneberg 453800211c
testrunner: make sure that more redirects/outputs are actually being consumed (#5721) 2023-12-06 22:01:00 +01:00
chrchr-github 613bbe7674
Fix #12249 Assert failure in ExpressionAnalyzer (#5731) 2023-12-06 20:04:20 +01:00
chrchr-github 6aa3478243
Add test for #11534 (#5732) 2023-12-06 18:11:31 +01:00
chrchr-github 918eca635d
Fix #2767 FP resourceLeak (regression) / #12248 FP memleak / #12204 FP memleak (#5723) 2023-12-06 10:17:32 +01:00
Oliver Stöneberg e766fba813
fixed tests by adjusting results for `picojson` update (#5729)
The tests which are failing were in introduced in #5712. Those were not
included in #5710 which updated `picojson` that resulted in the
different lines being reported in the error messages.

I also added some checks to `ScopeFile` which will indicate that a
temporary file already exists highlighting multi-threading issues and
leftover files from previously aborted testruns. I ran into his while
looking into these failing tests
2023-12-05 20:39:26 +01:00
Daniel Marjamäki 70745b527a
Fix #12210 (Cppcheck hang in SymbolDatabase::createSymbolDatabaseExprIds) (#5699) 2023-12-05 14:22:32 +01:00
chrchr-github 41e6c87cb2
Fix #12236 FP related to decltype/__typeof__ (#5717) 2023-12-04 11:19:49 +01:00
Paul Fultz II 6192d0d3fa
Add unit tests for expr ids (#5722) 2023-12-03 22:18:35 +01:00
chrchr-github ae27b613ae
Fix #12239 FP memleak when passing this in allocation (#5719) 2023-12-02 14:15:10 +01:00
Oliver Stöneberg ec9dbb31f4
testrunner: make sure all redirected output is being consumed / some cleanups (#5714) 2023-12-01 20:56:30 +01:00
chrchr-github 55c2b75c2e
Fix #6933 FN uninitvar with POD struct and STL types (#5713)
Co-authored-by: chrchr-github <chrchr@github>
2023-12-01 17:42:27 +01:00
Oliver Stöneberg 3272a2bbe7
greatly improved `Settings::loadCppcheckCfg()` error handling (#5712)
This also fixes the issue that `cppcheck.cfg` is no longer being loaded
from executable path. That was introduced by #5704.
2023-12-01 16:34:14 +01:00
chrchr-github d6a1a657df
Fix #11796 FN memleak with brace init (#5708)
Co-authored-by: chrchr-github <chrchr@github>
2023-12-01 15:39:16 +01:00