Commit Graph

27698 Commits

Author SHA1 Message Date
Daniel Marjamäki b6e157408c
triage: fix broken signal-slot when double-clicking result (#5810) 2023-12-27 12:25:40 +01:00
Christoph Grüninger 4a9b921ccf
Fix two types of Clazy warnings (#5807)
Chained QString::arg, replace inclusion of QtCore
2023-12-27 10:36:18 +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
Tomo Dote c02d0786ad
Add Japanese translation for 2.13.0 (#5806)
This is just adding Japanese translation only.

Happy holidays
2023-12-24 13:00:15 +01:00
thingsconnected d506e7e937
addons/namingng.py: allow function/variable name test without prefixes (#5801)
This patch allows a config file to have RE_VARNAME and RE_FUNCTIONNAME
without the corresponding var_prefixes and function_prefixes keys. The
namingng.py processing function would otherwise raise an exception
trying to get these keys, while they are not strictly necessary, if no
prefixes are required.
2023-12-23 22:33:36 +01:00
chrchr-github 9118d330d3
Fix test failure on 32bit platform (#5803) 2023-12-23 20:59:59 +01:00
orbitcowboy 06e6c3eba4
cppcheck-htmlreport: Added clear button inside 'File' and 'Filter' text box (#5805)
This is a cosmetic change. When the user enters text to either the
"File" or "Filter" option, a clear button is shown now.
2023-12-23 19:32:13 +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 2af3b7bf44
createrelease: nothing new, tweak instructions [ci skip] (#5800) 2023-12-23 09:23:53 +01:00
Daniel Marjamäki c9401a576d
daca@home: use cppcheck-2.13.0 as old version [ci skip] (#5799) 2023-12-23 09:18:41 +01:00
Daniel Marjamäki 0fec74d867
createrelease: use -j12 to build faster, build with -O2 (#5798) 2023-12-23 08:18:34 +01:00
Daniel Marjamäki 79fb57e756
dmake: in run-dmake target run dmake with --release in a release Makefile (#5792) 2023-12-22 23:21:02 +01:00
Daniel Marjamäki 5a222b80a1
CI: fix --version tests (#5790) 2023-12-22 19:57:55 +01:00
Daniel Marjamäki 36b8e54b71
createrelease: update sed commands for writing cppcheck version (#5789) 2023-12-22 18:03:27 +01:00
Daniel Marjamäki d81c69682c
releasenotes.txt: new notes for 2.14 [ci skip] (#5787) 2023-12-20 22:19:37 +01:00
Daniel Marjamäki 5968a418b9
AUTHORS: Add syohex [ci skip] (#5786) 2023-12-20 22:14:47 +01:00
Daniel Marjamäki 948f822943
2.13: Update copyright year [ci skip] (#5785) 2023-12-20 21:41:58 +01:00
Daniel Marjamäki afcbe65e0b
GUI: Update translations (#5784) 2023-12-20 21:37:23 +01:00
Daniel Marjamäki d36d26dcdd AUTHORS: Add dirkmueller [ci skip] 2023-12-19 20:45:59 +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
Eric Sesterhenn 3b1c701766
fix casing in variable name (#5778)
The attribute movedValue is misspelled with an uppercase V, this leads
to errors when printing token values:

```
$ python3 runaddon.py test.py test.c.dump 
Checking test.c.dump...
Checking test.c.dump, config ...
line 2 str=""lala\n""
Traceback (most recent call last):
  File "/home/eric/tools/cppcheck/addons/runaddon.py", line 11, in <module>
    cppcheck.runcheckers()
  File "/home/eric/tools/cppcheck/addons/cppcheck.py", line 39, in runcheckers
    c(cfg, data)
  File "test.py", line 9, in func
    print(f'    {value}')
  File "/home/eric/tools/cppcheck/addons/cppcheckdata.py", line 907, in __repr__
    ", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs))
  File "/home/eric/tools/cppcheck/addons/cppcheckdata.py", line 907, in <genexpr>
    ", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs))
AttributeError: 'Value' object has no attribute 'movedValue'
```
2023-12-18 18:57:08 +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 34fb24d5a9
tools/extracttests.py: test code was not extracted properly for some tests (#5776) 2023-12-17 20:04:17 +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 1c7036f174
daca@home: update client version [ci skip] (#5774) 2023-12-17 16:38:52 +01:00
Daniel Marjamäki e7d0bb0009
daca@home: If cppcheck binary does not handle --unsafe-exitcode then execute without it [ci skip] (#5773) 2023-12-17 16:33:00 +01:00
Daniel Marjamäki 150ca20404
daca@home: use --unsafe-exitcode (#5772)
the daca script will think that analysis crashed otherwise.
2023-12-17 16:11:38 +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
Daniel Marjamäki 22613dc7fb
Fixed #12267 (Misra.py: crashes in 17.7 checker when there is macro in variable declaration) (#5768) 2023-12-15 22:53:19 +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
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 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
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
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
Daniel Marjamäki bc5023775d
Partial fix for #12254 (cppcheck.cfg can't be loaded from relative paths anymore) (#5760) 2023-12-13 06:53:03 +01:00