Commit Graph

1319 Commits

Author SHA1 Message Date
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
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
Daniel Marjamäki d695c6c766
Update tools/get_checkers.py and lib/checkers.cpp (#5749) 2023-12-11 15:18:19 +01:00
Oliver Stöneberg 4182f943aa
use more granular suppressions in selfcheck and prefer inline suppressions (#5703) 2023-12-01 15:59:01 +01:00
Oliver Stöneberg f2461781fd
added `xml.h` wrapper for TinyXML2 / cleaned up suppressions of Clang compiler warnings (#5700) 2023-11-26 14:04:35 +01:00
Oliver Stöneberg 3bafe164a3
enabled some clang-tidy warnings for non-GUI code (#5679)
There are some clang-tidy warnings which cannot properly handle the
extensions used in the Qt code so the produce lots of false positives
and were previously enabled. With clang-tidy now offering the
possibility to inherit the parent configuration we can enable these
across the project and simply disable them for the GUI code.

No additional warnings were found as they were already fixed in earlier
commits without enabling the checks in question.
2023-11-20 10:06:46 +01:00
Oliver Stöneberg 92c089d4ad
fixed some "Parameter can be made pointer/reference to const" Rider warnings (#5680) 2023-11-20 07:23:45 +01:00
Daniel Marjamäki ae3f7bd800
Fixed #12187 (Windows build GUI with cmake) (#5662) 2023-11-15 16:56:46 +01:00
Oliver Stöneberg bc174c502a
fixed #12145 - provided order of source files is not preserved (#5625) 2023-11-07 21:21:24 +01:00
orbitcowboy 966a89d5f4
Removed -DTIXML_USE_STL flag (#5624)
Updated version of https://github.com/danmar/cppcheck/pull/5145
2023-11-05 15:54:22 +01:00
Oliver Stöneberg 63e00ea918
fixed some "Variable can be made constexpr" Rider warnings (#5615) 2023-11-03 09:55:44 +01:00
Oliver Stöneberg e6d15b17ff
extracted `FileSettings` from `ImportProject` to `filesettings.h` (#5604) 2023-11-02 17:42:41 +01:00
Oliver Stöneberg 57bec6cbc8
fixed #12099 - daca: missing diff entries (#5586)
This reverts 7ff58dacff.
2023-11-01 22:58:33 +01:00
Oliver Stöneberg 309b4d8501
donate-cpu: some small improvements (#5585)
- added timing information to "finished" log message in `scan_package()`
- adjusted some log messages
- avoid unnecessary `git checkout` invocation if non-`main` binary
already exists
2023-10-23 12:53:34 +02:00
Oliver Stöneberg 3103736c51
refs #11928 / refs #10045 / fixes #11794 - generate `limits.h`/`climits` defines from platform (#5414) 2023-10-21 17:21:12 +02:00
Oliver Stöneberg d757f8b8fc
fixed #12058 - donate_cpu_lib.py: removed `--showtime=none` option not supported by the previous version (#5538) 2023-10-10 11:53:46 +02:00
Oliver Stöneberg 2f62e9d316
mitigated several compiler warnings / suppress compiler warnings in CI where we don't care about them (#5497)
There's no need to generate any warnings in the CI unless we react on
them.
2023-10-09 12:25:56 +02:00
Oliver Stöneberg fc700b68eb
refs #4452 / refs #11705 - improved `--showtime=` behavior and testing (#4876)
This is a step onto leveraging the `ThreadExecutor` implementation for
`ProcessExecutor` which is a follow-up to #4870. We need to have the
proper test coverage and the existing implementations working as
expected before we move to the shared code.

Fixes:
- added `--showtime=` tests for all executor implementations
- only print `--showtime=summary` once at the end
- prevents `--showtime=` by multiple threads to be written at the same
time - essentially breaking the output
- reset the timer results before each test
- deprecated `top5` in favor of `top5_file`
- fixed printing for all executors except `ProcessExecutor`
2023-10-05 19:04:06 +02:00
Oliver Stöneberg e6e273645d
donate_cpu_lib.py: increased the amount of upload tries (#5476) 2023-09-22 19:41:52 +02:00
Oliver Stöneberg c527af9042
donate-cpu-server.py: fixed "top x" reports / some cleanups (#5475)
This broke with a late variable name cleanup I did in
`check_library_report()` after testing it locally.
2023-09-22 15:18:16 +02:00
Oliver Stöneberg ba23b20264
donate-cpu-server.py: filtered out various outdated and undesired (diff) results from reports / cleanups (#5474) 2023-09-22 12:17:33 +02:00
Oliver Stöneberg 6fcf11b831
donate-cpu-server.py: added `pkgs` query parameter to `check_library-*`, `incomplete_var-*` and `unknown_macro-*` reports (#5471)
This also fixes the missing results for `;` and filters out outdated
results.
2023-09-21 15:25:18 +02:00
Oliver Stöneberg 5ae136a1be
donate-cpu-server.py: added "top x" report for `unknownMacro` (#5466) 2023-09-20 11:23:04 +02:00
Paul Fultz II e6632d93e3
Fix 11983: False positive: uninitialized variable (#5443) 2023-09-13 23:27:08 +02:00
Oliver Stöneberg b31860b72d
fixed #11925 (build slowest files first) (#5419)
This will mainly help if you only build the `cppcheck` targets and the
more threads you utilize for compilation.
2023-09-11 20:22:07 +02:00
Daniel Marjamäki 2a4d7f7cda daca: use 2.12.0 as old version 2023-09-10 15:28:02 +02:00
Oliver Stöneberg 91070ca794
utils.h: added `startsWith()` and started using it (#5381)
This makes the code much more readable. It also makes it less prone to
errors because we do not need to specify the length of the string to
match and the returnvalue is clear.

The code with the bad returnvalue check was never executed and I added a
test to show that.
2023-09-08 19:30:25 +02:00
Oliver Stöneberg 51d1758720
fixed #11930 (Create daca report for `valueFlowBailoutIncompleteVar`) (#5417)
This provides a report of the top incomplete variables reported by the
ValueFlow analysis. This is based on the implementation of the existing
`--check-library` reports.
2023-09-08 18:08:44 +02:00
Oliver Stöneberg ce780177b2
fixed #11910 - removed Visual Studio x86 targets from project files and builds from CI (#5397)
Windows XP Pro x64 was released on April 25, 2005 and consumer
processors supporting x86-64 have been around almost as long. Although
there are still 32-bit Windows images available there is not much of a
point maintaining support for these. We also never did any x86 builds
for non-Windows platforms in CI so we don't even know if we work on
those. You might still be able to build 32-bit binaries via CMake.
2023-09-04 19:40:13 +02:00
Daniel Marjamäki 6817113665
Ticket #11897. Write Autosar/Cert C/Cert C++/Misra C++ in the checkers report also. (#5400) 2023-09-03 20:42:09 +02:00
Daniel Marjamäki 44c149e51b
Fix #11897 (Safety: show what checks are enabled/disabled) (#5378)
This primarily adds the corresponding report in the GUI that we have in
the command line already
2023-08-31 18:28:47 +02:00
Daniel Marjamäki 276f017fbe
Partial fix for #11897 (Safety: show what checks are enabled/disabled) (#5372)
Example output on stdout:
```
$ ./cppcheck m1.cpp 
Checking m1.cpp ...
Active checkers: 59/177
```
2023-08-29 12:00:52 +02:00
Oliver Stöneberg d8b44dff56
fixed/suppressed several compiler warnings (#5327) 2023-08-16 19:35:53 +02:00
Oliver Stöneberg 4aae670b45
donate-cpu: fixed #11276 (donate-cpu: Improve library detection) / respect `--no-upload` in "nodata" uploads (#5292)
We were only matching each library once as the entry was removed from
the container stored in the class as we did not modify a copy but a
reference.
2023-08-04 10:30:58 +02:00
Oliver Stöneberg de0fdc85a2
donate-cpu-server.py: adjusted head information summary name / added `internalError` to overview (#5283) 2023-08-02 10:43:06 +02:00
Daniel Marjamäki 682bdd3e53
Fix #11813 (daca: script crashes (UnicodeDecodeError) when checking package lgeneral) (#5217) 2023-07-04 19:17:26 +02:00
Daniel Marjamäki 7ff58dacff
daca: filter checker results when there are syntaxError/unknownMacro/etc (#5214) 2023-07-04 13:23:19 +02:00
chrchr-github f4030c4b1a
Fix #11791 Build regression with GCC 13 (#5193)
Patch supplied by Joachim Reichel.
2023-06-26 11:15:41 +02:00
Daniel Marjamäki bb2711c22a daca: Update old version to 2.11 2023-06-22 23:17:53 +02:00
Long Radix c033c62190
Typos and stilistic updates (#5141) 2023-06-14 12:30:45 +02:00
Andrew C Aitchison 0727528876
The threadsafety.py addon now flags MT-Unsafe symbols and functions. (#5086) 2023-06-08 14:46:09 +02:00
Rainer Wiesenfarth f4f58bf020
Fix #11081 GUI: Windows release build crashes (#5083)
* Fix #11081 GUI: Windows release build crashes

Use generator expressions rather than if statements when adding compiler
options or definitions.

* Fix #11081 GUI: Windows CMake debug build fails with default options

When DISABLE_CRTDBG_MAP_ALLOC is using the default value (OFF), the
debug build of cppcheck-gui fails, as the "realloc" method names in some
of the Qt headers are replaced by the macro defined by the compiler.
Thus DISABLE_CRTDBG_MAP_ALLOC is explicitely set when compiling
cppcheck-gui in Debug mode using MSVC.
2023-06-07 11:33:55 +02:00
Daniel Marjamäki 956bb3ce8c
test-my-pr: use --packages-path if you want to check packages in a path (#5077) 2023-05-23 09:51:51 +02:00
chrchr-github 78182d4773
Fix FN constVariablePointer (#5076)
* Fix FN constVariablePointer

* Fix FP

* Add const

* Fix tests

* Add const
2023-05-22 19:53:51 +02:00
Oliver Stöneberg e6ae312a0b
moved more code into `HAVE_RULES` (#4956)
* moved more code into `HAVE_RULES`

* properly enable all internal and rules code in selfcheck

* updated TODOs in selfcheck

* testrunner.vcxproj.filters: updated

* added missing `Debug-PCRE` and `Release-PCRE` configurations for `testrunner` Visual Studio project

* cppcheck.cpp: fixed `useStlAlgorithm` selfcheck warning
2023-05-04 10:54:19 +02:00