Commit Graph

27402 Commits

Author SHA1 Message Date
chrchr-github 033cf64961
Avoid const_cast (#5490) 2023-09-28 18:20:43 +02:00
Daniel Marjamäki ed5532c2a7
Fix #12019 (False positive: null pointer, array zero initialization) (#5495) 2023-09-28 15:18:08 +02:00
Daniel Marjamäki c4fe5ac8b7
Fix #12012 (FP: uninitvar, address of variable is casted to uintptr_t that is passed to function) (#5494) 2023-09-28 13:47:11 +02:00
Daniel Marjamäki db5f75f741
manual: Add manual-premium.md for the Cppcheck Premium manual (#5492) 2023-09-28 13:30:58 +02:00
chrchr-github 63b76d2266
Fix valueFlowBailoutIncompleteVar with ptr to ptr (refs #10045) (#5488) 2023-09-28 10:36:18 +02:00
chrchr-github 73d305ea46
Fix #12013 crash: crashes in release builds if cppcheck build dir is used (#5489) 2023-09-27 16:44:22 +02:00
Oliver Stöneberg ca20152e51
findDependencies.cmake: use `FindPython` instead of deprecated `FindPythonInterp` (#5485)
This fixes the following warning with CMake 3.27:
```
CMake Warning (dev) at cmake/findDependencies.cmake:42 (find_package):
  Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
  are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

Call Stack (most recent call first):
  CMakeLists.txt:15 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.
```
2023-09-27 10:06:03 +02:00
chrchr-github e928f2b5aa
Fix valueFlowBailoutIncompleteVar with new (refs #10045) (#5487) 2023-09-26 21:39:07 +02:00
Oliver Stöneberg 3774d46303
TestCmdlineParser: store messages in logger class instead of utilizing the redirect (#5482) 2023-09-26 21:38:15 +02:00
chrchr-github 4ba19c42ba
Bump simplecpp (fix #11991) (#5486) 2023-09-26 15:58:16 +02:00
Oliver Stöneberg a3ff6d53c4
added `-Werror` to pytest calls and fixed reported warnings (#5483) 2023-09-26 15:31:37 +02:00
Oliver Stöneberg a9952d9da6
CppCheck: avoid expensive `std::ostringstream` usage in `checkFile()` (#5481)
Scanning `common` from `xrdp` project with `DISABLE_VALUEFLOW=1` and
`-D__GNUC__ --addon=misra`:

Clang 16 `627,748,337` -> `541,852,912`
2023-09-26 14:22:52 +02:00
chrchr-github f037edf586
Fix #11440 FN Moved value when using {} to initialize (#5479) 2023-09-26 10:04:22 +02:00
Oliver Stöneberg 9f96803f62
TestCheck: added missing registration (#5484) 2023-09-26 10:03:53 +02:00
chrchr-github 99e38cf8f8
Partial fix for #10968 FN detect always false/true comparison of function with constant (#5480) 2023-09-25 22:18:07 +02:00
Oliver Stöneberg 3fd00c19df
perform logging in `CmdLineParser` through an interface (#5478)
This is in preparation of avoiding accessing `std::cout` directly as
well as streamlining and improving the logging during the settings
parsing. There are no functional changes yet.
2023-09-25 13:43:18 +02:00
Oliver Stöneberg 1959c85e34
test/cli/test-other.py: improved addon tests (#5469) 2023-09-25 13:39:17 +02:00
Oliver Stöneberg 3979ade9ea
got rid of test-only `Library` functions / avoid some more direct modifications of library data structures in test (#5468) 2023-09-25 13:37:24 +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
chrchr-github bba96c5c8f
Fix valueFlowConditionExpressions bailout for C++ casts (refs #10045) (#5472) 2023-09-22 18:19:36 +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
chrchr-github b745d9ad6e
Fix #12010 Improve unknownMacro message: int (#5473) 2023-09-22 10:16:21 +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
chrchr-github dc59543348
Fix #12006 Improve unknownMacro message (#5470) 2023-09-21 00:28:49 +02:00
chrchr-github 57bbb17f3b
Fix #11986 debug: Executable scope 'x' with unknown function. (#5463) 2023-09-20 17:18:00 +02:00
chrchr-github dc19916966
Fix valueFlowConditionExpressions bailout for library function (refs #10045) (#5461) 2023-09-20 15:49:13 +02:00
Oliver Stöneberg 4af2f991c2
removed unused `daca.cfg` (#5467)
It appears this file was never used. And we shouldn't. Although this
will help with reducing warning and improving coverage in daca it will
not improve the analysis for the user. It might also mask issues.
2023-09-20 14:46:12 +02:00
Oliver Stöneberg f49fedb2ad
fixed #11483 (FN unusedFunction for method with inline implementation) (#5457)
Co-authored-by: chrchr-github <78114321+chrchr-github@users.noreply.github.com>
2023-09-20 14:45:44 +02:00
Andy Holmes da09580dde
gtk.cfg: add G_DEFINE_QUARK() (#5464) 2023-09-20 11:58:19 +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
Oliver Stöneberg 21e001cd1a
refs #11993 - error out in `TestFileLister::recursiveAddFiles()` instead of looping infinitely when repository root directory is not found (#5462)
Not a proper fix yet but at least it prevents the hang and gives some
feedback.
2023-09-20 10:49:00 +02:00
Oliver Stöneberg a43b55a0ca
Improved addon execution errorhandling (#5451) 2023-09-20 10:40:57 +02:00
Paul Fultz II 58a7519cbb
Fix 11992: FN (regression): uninitvar (#5465) 2023-09-20 06:43:58 +02:00
Daniel Marjamäki 3089fc393b
Fix #12002 (Filelister: Unclear error 'finding files failed (error: 3)') (#5460) 2023-09-19 15:36:34 +02:00
chrchr-github c6b3c56174
Improve findEnumerator() (refs #10045) (#5459) 2023-09-19 11:45:59 +02:00
Oliver Stöneberg 176edbd22c
added `--strict` and `-vv` to pytest calls (#5453) 2023-09-18 13:57:27 +02:00
Daniel Marjamäki e611b18ffc AUTHORS: Add alucarded [skip ci] 2023-09-18 13:55:53 +02:00
Tomasz Edward Posluszny b6f60ad952
Support importing projects with project-name (#5456) 2023-09-18 13:54:20 +02:00
chrchr-github 10c1ac977c
Fix findEnumerator() with nested enum (refs #10045) (#5454) 2023-09-18 12:09:59 +02:00
chrchr-github 640b561633
Fix #11995 FP passedByValue when variable is moved from (#5455) 2023-09-17 22:32:35 +02:00
chrchr-github 0c51977f86
Fix valueFlowBailoutIncompleteVar for cast and template args (refs #10045) (#5452) 2023-09-16 13:03:14 +02:00
Paul Fultz II df4457e895
Use intrinsics for source location if available (#5449)
Sometimes the compiler supports the intrinsic even if the C++ runtime
doesnt yet.
2023-09-15 17:18:08 +02:00
chrchr-github 50ba5061c7
Fix #11438 MathLib error on user defined literals (#5448)
Based on #4701, #5418

A helper function for the `isdigit()` test should be introduced on the
simplecpp side.

Co-authored-by: gerboengels <github@gerbo.org>
2023-09-15 10:00:00 +02:00
Daniel Marjamäki 79e8735d1a
cli: update --help output, premium has full cert c++ coverage (#5450) 2023-09-14 15:59:06 +02:00
chrchr-github 5a21851bb7
Fix #11981 internalAstError with using declaration (#5446) 2023-09-14 12:14:08 +02:00
chrchr-github 775af5ec70
Add test for simplecpp#314 (#5438) 2023-09-14 09:41:39 +02:00
Paul Fultz II e6632d93e3
Fix 11983: False positive: uninitialized variable (#5443) 2023-09-13 23:27:08 +02:00
Daniel Marjamäki 11e5c110e6 AUTHORS: Add markhermeling [skip ci] 2023-09-13 22:38:52 +02:00
Mark Hermeling 6e6b3747fd
Fix copy-paste-error (#5444)
This is a warning we found during static analyis with CodeSecure
CodeSonar.

It flagged a suspicious copy-paste error, where it finds code that seems
to have been copied from another location, with some, but not all,
variables substituted.

Unclear to me if this truly is a problem, or intentional, but I wanted
to provide the feedback as I am not sure how to test this.

Lines 5614 to 5619 in lib/symboldatabase.cpp are a copy from 5597-5602
with vartok replaced by valuetok, except for line 5616
2023-09-13 22:35:14 +02:00