26675 Commits

Author SHA1 Message Date
chrchr-github
ff0eee4d77
Fix #11558 FP knownConditionTrueFalse when checking for zero character (#4794)
* Fix #11558 FP knownConditionTrueFalse when checking for zero characte

* Fix test

* Set impossible value only for non-Boolean conditions, rename

* Fix condition
2023-02-18 17:35:12 +01:00
chrchr-github
1c11d3039d
Fix FP returnTempReference (#4793)
* Fix FP returnTempReference

* Fix mismatch between token and variable ValueType

* Format, clang-tidy

* Add test

* Format
2023-02-17 07:17:37 +01:00
Oliver Stöneberg
f0ebaf9536
compileroptions.cmake: fixed workaround for Clang >= 14 (#4737) 2023-02-16 16:42:08 +01:00
Oliver Stöneberg
367847cf57
updated CI to Clang 16 (#4641) 2023-02-15 19:46:13 +01:00
chrchr-github
33a03f2c35
Don't throw internalAstError for parameter pack in template argument list (#4773) 2023-02-15 19:43:18 +01:00
chrchr-github
4f8329b2df
Fix #11545 FP unreadVariable with std::span (#4792) 2023-02-14 06:11:24 +01:00
Daniel Marjamäki
ef49dff488 AUTHORS: add tlsa 2023-02-13 20:56:13 +01:00
Michael Drake
d651b6baf1
dump: Fix concurrency problem with dump files (#4757)
* dump: Fix concurrency problem with dump files

This adds the process ID for the cppcheck process to the filenames
of the .dump and .ctu-info files that the process generates.

So
  lib/cppcheck.cpp.dump
becomes
  lib/cppcheck.cpp.<PID>.dump

For example:
  lib/cppcheck.cpp.2637871.dump

The reason for this change is that if there is a buildsystem which
supports concurrency, multiple instances of cppcheck may be run for
the same file.  For example, if the same file is compiled in multiple
build variants, or for multiple targets.

If running the MISRA plugin over such a project with concurrency
enabled in the buildsystem, the plugin ends up crashing as multiple
jobs attempt to create/trample/delete the same files while other
jobs are using them.

For more information see:
    https://sourceforge.net/p/cppcheck/discussion/general/thread/02c757b4af/

* dump: Include pid in filename if dump not explicit

Only change the dump and ctu-info filenames to include the PID if
they are being generated due to an addon.

This means that existing scripts that use `--dump` will still work
if they depend on the previous naming behaviour. The more robust
filenames containing the pid will be used when the dump files are
used as an internal implementation detail for passing data to addons.

However this means that anything that does explicitly use `--dump`
will be susceptible to concurrency problems.

* test: Update addon dump file test to account for pid

This test causes a dump file to be created by enabling the misra
addon. Since the dump files now include the cppcheck process pid
this test had to be updated to account for the change.
2023-02-13 20:54:21 +01:00
Oliver Stöneberg
26bb55154f
CI-windows.yml: updated to Qt 6.4.2 in CI (#4588) 2023-02-12 16:03:11 +01:00
Oliver Stöneberg
8c527bf132
std.cfg: added support for more container methods (#4780)
* std.cfg: added support for `std::unordered_map::count()`

* std.cfg: added support for `std::multimap::count()`

* std.cfg: added support for `std::unordered_map::insert()`

* std.cfg: added support for `std::unordered_set::insert()`

* std.cfg: added support for `std::unordered_set::emplace()`
2023-02-11 10:48:17 +01:00
chrchr-github
2379239aed
Fix FP ignoredReturnValue (#4783) 2023-02-11 10:46:04 +01:00
Oliver Stöneberg
132a5a31cf
improved setting of platform in tests / also improved platform tests (#4787)
* fixture.h: added TODO

* TestPlatform: improved tests for built-in platforms

* TestPlatform: changed tests to TODO asserts

* testfilelister.cpp: added TODO

* fixture.h: added `PLATFORM` macro to load platform / use `PLATFORM` in tests

* platform.h: corrected capitalization in `Platform::platformString(PlatformType)` and bail on unknown type

* fixture.h: fixed `readability-redundant-string-cstr` clang-tidy warning

* testplatform.cpp: fixed `functionConst` selfcheck warnings
2023-02-11 10:44:56 +01:00
chrchr-github
2be1e36603
qt.cfg: add support for Q_EMIT (#4786) 2023-02-11 10:43:07 +01:00
Paul Fultz II
2b9af94b9a
Fix 11548: FP knownConditionTrueFalse with empty() == false (#4788)
* Fix 11548: FP knownConditionTrueFalse with empty() == false

* Format

* Fix test
2023-02-11 10:42:13 +01:00
Oliver Stöneberg
a846bc2d99
added precompiled header for cli (#4779) 2023-02-08 21:11:11 +01:00
Oliver Stöneberg
f7a415dbf3
Token: do not return non-const pointer from const methods - part 1 (#4761) 2023-02-08 21:07:16 +01:00
Oliver Stöneberg
8ef14dad98
fixed and enabled performance-faster-string-find clang-tidy warning (#4769) 2023-02-08 21:01:51 +01:00
Oliver Stöneberg
14e78e1800
greatly improved error handling in Cppcheck project file parsing / some cleanups (#4752) 2023-02-08 20:30:43 +01:00
chrchr-github
0dddba3bd6
Fix cfg for std::xstream::write() (#4778) 2023-02-08 08:59:13 +01:00
chrchr-github
271ccbc8f3
Fix FP constVariable with reference to std::array (#4777) 2023-02-08 08:25:43 +01:00
Oliver Stöneberg
66758d65f9
updated precompiled headers based on ClangBuildAnalyzer (#4775) 2023-02-08 08:19:21 +01:00
Tobias
608be24726
gnu.cfg: strcasestr wrong return type (#4776) 2023-02-07 23:17:25 +01:00
chrchr-github
119a681265
Fix #11536 Do not exclude "debian" subdirectory in .gitignore (#4772) 2023-02-07 22:37:07 +01:00
chrchr-github
1fcea5fb03
Don't crash on C++23 code (#4771) 2023-02-07 22:36:42 +01:00
chrchr-github
55292d476a
Fix #11535 "debug: Executable scope 'x' with unknown function" (#4770) 2023-02-07 22:35:58 +01:00
chrchr-github
847d7583e4
Add test for FP fixed by e8c3a80 (#4768) 2023-02-07 22:09:55 +01:00
chrchr-github
c3225781f3
Fix #11533 Infinite recursion in typeDecl() (#4767) 2023-02-07 22:02:59 +01:00
Oliver Stöneberg
4d9caa99f3
improved testing of missing includes / made it possible to clear the include cache in simplecpp (#4704) 2023-02-07 22:02:12 +01:00
Oliver Stöneberg
41d2d1b0b5
added a script to bisect regressions (#4286) 2023-02-07 21:59:52 +01:00
chrchr-github
132ae52428
Don't show checkLibraryFunction warning for types with unusedvar configuration (#4765) 2023-02-07 21:58:44 +01:00
chrchr-github
8af1026696
Set functions for calls through iterators (#4763) 2023-02-07 21:57:59 +01:00
Oliver Stöneberg
20ff2d7172
donate_cpu_lib.py: use subprocess.check_call() so failed calls will actually raise an exception (#4750) 2023-02-07 21:42:37 +01:00
chrchr-github
d06f93aebf
Fix #11458 nullPointer false positive (#4758) 2023-02-06 22:06:04 +01:00
chrchr-github
a666e31801
Fix #11517 FP constVariable with dynamic_cast (#4753) 2023-02-06 22:05:07 +01:00
chrchr-github
4f915499d4
Fix #11091 FP: Using object that is a temporary (#4754) 2023-02-06 22:04:27 +01:00
chrchr-github
d8323c367e
std.cfg: use-retval for container member functions (#4766) 2023-02-06 22:03:23 +01:00
Oliver Stöneberg
7dde6c5d29
CheckExceptionSafety: moved CWE objects into source file (#4759) 2023-02-06 22:01:31 +01:00
Mateusz
7ae7ad60d8
Added cfg information about std::span (#4762)
* Added cfg information about std::span

* Add tests for span handling

* Add details about functions and tests fo std::span

* Add tests in dangingLifetimeContainerView for span

* Reduce c++ version from 20 to 2a

* Add checking if span is supported in std lib cfg checks
2023-02-05 18:10:08 +01:00
chrchr-github
5818520b4b
Fix FN stlcstrAssignment (#4764) 2023-02-03 14:10:27 +01:00
chrchr-github
e8c3a80678
Improve --check-library error message (#4755) 2023-02-01 14:53:57 +01:00
Rikard Falkeborn
9acc9659aa
test-my-pr robustification (#4756)
* Add try_retry-logic to get_packages_count()

Occasionally, get_packages_count() fails, which is a bit annoying since
it happens after compilation and therefore can take some time to detect.
Add try-retry to the function to make it more robust.

* Move try_retry-logic to lib.get_package()

Moving it to the library means test-my-pr also benefits from it. This
fixes Trac ticket #11405.
2023-01-31 22:39:55 +01:00
Daniel Marjamäki
d3e7566470 GUI: Set proper title for compliance report dialog 2023-01-30 20:39:30 +01:00
Daniel Marjamäki
e1b313ba76 GUI: Generate compliance report 2023-01-30 14:59:45 +01:00
Oliver Stöneberg
7c7ccdf7c0
Check: disallow more than one instance per check (#4749) 2023-01-29 17:23:03 +01:00
Oliver Stöneberg
1a460d7bc0
bumped version to 2.11 (#4751) 2023-01-29 15:18:22 +01:00
Daniel Marjamäki
a64dfbc519 daca: update old version 2023-01-28 14:53:47 +01:00
Daniel Marjamäki
e2bf473f71 Updated AUTHORS 2023-01-28 10:35:08 +01:00
Oliver Stöneberg
afd13ea11d
ValueFlow: some interface and namespace cleanups (#4746) 2023-01-28 10:20:47 +01:00
Daniel Marjamäki
464fbe8d53 Update copyright year 2023-01-28 10:16:34 +01:00
Daniel Marjamäki
1f9eb757a5 GUI: Update translations 2023-01-28 10:15:00 +01:00