Commit Graph

1368 Commits

Author SHA1 Message Date
Oliver Stöneberg bbd2b2aa83
cleaned up includes based on `include-what-you-use` (#5855) 2024-01-07 11:07:51 +01:00
Oliver Stöneberg 957096417e
fixed some `modernize-use-auto` clean-tidy warnings (#4663) 2024-01-05 13:22:37 +01:00
chrchr-github b26b78b86d
Fix #12258 Assert failure in setSymbolic() (#5759) 2023-12-12 22:37:33 +01:00
chrchr-github 7ac824f38a
Fix #12249 Assert failure in ExpressionAnalyzer (II) (#5733) 2023-12-08 14:46:20 +01:00
chrchr-github 613bbe7674
Fix #12249 Assert failure in ExpressionAnalyzer (#5731) 2023-12-06 20:04:20 +01:00
Oliver Stöneberg 5761e55a67
avoid `const_cast` usage in headers (#5720) 2023-12-06 14:15:35 +01:00
Daniel Marjamäki 70745b527a
Fix #12210 (Cppcheck hang in SymbolDatabase::createSymbolDatabaseExprIds) (#5699) 2023-12-05 14:22:32 +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
chrchr-github c1f6132745
Fix #12219 FP constParameterCallback for template argument (#5695) 2023-11-25 22:57:07 +01:00
chrchr-github 8b6cbe2e9e
Fix crash in SymbolDatabase::addClassFunction() (f'up to #12209) (#5689) 2023-11-21 12:57:38 +01:00
Oliver Stöneberg 2b61c9ef2f
Tokenizer: moved `VariableMap` into anonymous namespace (#5686) 2023-11-21 11:35:17 +01:00
chrchr-github f5630e7049
Fix #12209 "debug: Executable scope 'x' with unknown function." with anonymous namespace (#5688) 2023-11-20 22:28:38 +01:00
chrchr-github f9521cfb4e
Fix #12208 FN constParameterReference with nested struct/class (#5685) 2023-11-20 22:01:22 +01:00
chrchr-github d3d70dcc4e
Fix #12157 SymbolDatabase: Token::type() is not set properly when inn… (#5635)
…er enum has same name as outer class
2023-11-07 19:57:45 +01:00
chrchr-github d26022ac9a
Fix #11302 debug: SymbolDatabase::isFunction found C function 'main' without a return type. (#5630) 2023-11-06 21:03:11 +01:00
Daniel Marjamäki fc8c244675
CI: Add selfcheck using Cppcheck Premium. Activates Misra C++ 2008 and Cert C++ 2016 checkers. (#5623) 2023-11-06 15:31:47 +01:00
chrchr-github f6fb3334f3
Set enumerator in ctor init list (refs #10045) (#5599) 2023-10-28 13:51:52 +02:00
Oliver Stöneberg bfe19af6b2
fixed some "Declaration and assignment can be joined" Rider warnings (#5569) 2023-10-18 10:06:17 +02:00
Oliver Stöneberg 85fe627c68
fixed some typos (#5562) 2023-10-17 18:32:07 +02:00
Oliver Stöneberg 3811d01498
fixed "Redundant dereferencing and tasking address expression" Rider warnings (#5563) 2023-10-16 14:09:03 +02:00
Oliver Stöneberg 5e89eb05a6
iwyu.yml: made `include-what-you-use` output more verbose / cleaned up includes (#5540) 2023-10-16 12:57:49 +02:00
Oliver Stöneberg ebb877adcc
gui/platforms.h: renamed `Platform` to `PlatformData` / Platform: removed unnecessary `cppcheck` namespace (#5545) 2023-10-13 16:02:04 +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
Daniel Marjamäki 47d2c0f619
Fix Cert C++ warnings reported by Cppcheck Premium (#5528) 2023-10-09 11:20:56 +02:00
Oliver Stöneberg fe8730cf0f
MathLib: renamed `to{U}LongNumber()` to `toBig{U}Number()` (#5503)
The name was misleading as it was actually a `long long` and also if we
ever move to an (optional) 128-bit value it wouldn't even less fitting.
We should name it to match our alias type.
2023-10-05 19:21:42 +02:00
chrchr-github d9a8909d2a
Fix #11408 debug: Function::addArguments found argument 't' with varid 0 (#5507) 2023-10-05 10:01:46 +02:00
chrchr-github 63b76d2266
Fix valueFlowBailoutIncompleteVar with ptr to ptr (refs #10045) (#5488) 2023-09-28 10:36:18 +02:00
chrchr-github e928f2b5aa
Fix valueFlowBailoutIncompleteVar with new (refs #10045) (#5487) 2023-09-26 21:39:07 +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
chrchr-github bba96c5c8f
Fix valueFlowConditionExpressions bailout for C++ casts (refs #10045) (#5472) 2023-09-22 18:19:36 +02:00
chrchr-github dc19916966
Fix valueFlowConditionExpressions bailout for library function (refs #10045) (#5461) 2023-09-20 15:49:13 +02:00
chrchr-github c6b3c56174
Improve findEnumerator() (refs #10045) (#5459) 2023-09-19 11:45:59 +02:00
chrchr-github 10c1ac977c
Fix findEnumerator() with nested enum (refs #10045) (#5454) 2023-09-18 12:09:59 +02:00
chrchr-github 0c51977f86
Fix valueFlowBailoutIncompleteVar for cast and template args (refs #10045) (#5452) 2023-09-16 13:03:14 +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
chrchr-github 844ed2bf22
Fix #11421 FP shiftTooManyBits with 64bit enum (#5406) 2023-09-13 17:59:47 +02:00
Daniel Marjamäki 7d1423c5fb
Fix #11975 (SymbolDatabase: findFunction does not find the correct function) (#5440) 2023-09-13 13:37:57 +02:00
Oliver Stöneberg 02b836baad
do not pass POD types by reference (based on clazy `function-args-by-value` check) (#5388) 2023-09-11 20:40:39 +02:00
chrchr-github cbbf500cd4
Fix valueFlowBailoutIncompleteVar for init list (refs #10045) (#5433) 2023-09-11 16:49:39 +02:00
Daniel Marjamäki 87719121bd
Fixed #11908 (SymbolDatabase: array not parsed properly 'int (**rs)[32]') (#5430) 2023-09-10 20:58:30 +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
Daniel Marjamäki c3136dbc2a
Refactor: The code to generate id string from pointer can be simplified (#5382) 2023-08-31 23:14:28 +02:00
Daniel Marjamäki 85332b2af6
Fixed #11904 (One more related fix for Scope::findFunction) (#5383) 2023-08-31 23:12:54 +02:00
Daniel Marjamäki 1b061564d9
Fix #11904 (Scope::findFunction: better handling when non-virtual method with same name and arguments exists both in base class and derived class) (#5379) 2023-08-31 14:44:44 +02:00
Oliver Stöneberg 0fadf9ed25
sped up `Tokenizer::dump()` (#5009)
Scanning the `cli` folder with `DISABLE_VALUEFLOW=1` `Tokenizer::dump()`
will consume almost 25% of the total Ir count when an addon is
specified. This is mainly caused by the usage of `std::ostream`.

Encountered while profiling #4958.
2023-08-31 11:54:46 +02:00
chrchr-github 4d18f3e68b
Fix use-after-free crash when using --clang (#5367)
Still ran into an assert failure in `Tokenizer::hasIfdef()`, since some
checks assume that the tokenizer is always present. Seems like
clangimport is yet another rogue under-tested feature...
2023-08-28 09:28:47 +02:00
chrchr-github 6ffe08c9b3
Fix #11886 performance regression (hang) in 2.12dev (#5355)
Or maybe we should just limit the recursion depth.
2023-08-22 21:01:52 +02:00
chrchr-github 05a2d88ec8
Fix #11888 FP knownPointerToBool with incorrect overload match / FP unreadVariable (#5356) 2023-08-22 16:53:38 +02:00
Oliver Stöneberg a92b10ca3b
fixes #11104 (avoid C++-only parsing when processing C code in parsedecl()) / also avoid remaining `Library::detect*()` calls (#5346) 2023-08-18 22:48:24 +02:00
chrchr-github 7f22ef4e14
Set ValueType for auto with ternary (#5304) 2023-08-18 10:33:26 +02:00