Commit Graph

389 Commits

Author SHA1 Message Date
Paul Fultz II 4b4037540a
valueFlowUninit: Handle arrays and pod types (#3917)
* valueFlowUninit: Handle arrays and pod types

* Format

* Catch another array case
2022-03-24 06:35:44 +01:00
chrchr-github 4c85ac0d7b
Fix #10852 FP unused struct member (inner struct in C code) (#3890)
* Fix #10852 FP unused struct member (inner struct in C code)

* Redundant findType() call, add test
2022-03-12 06:16:29 +01:00
Oliver Stöneberg 4a63af02ed
enabled functionConst and functionStatic in selfcheck (#3862)
* fixed functionConst findings and enabled it in selfcheck

* fixed functionStatic findings and enabled it in selfcheck

* .travis_suppressions: adjusted comment

* testimportproject.cpp: added missing asserts
2022-03-02 07:46:47 +01:00
chrchr-github edc5106237
Fix #9092 FN missingOverride - subclass in namespace (#3793) 2022-02-12 08:19:07 +01:00
Oliver Stöneberg 6e57cc4323
small utils.h cleanup (#3821) 2022-02-11 19:44:08 +01:00
Daniel Marjamäki 3989408738 Update copyright year 2022-02-05 11:45:17 +01:00
Oliver Stöneberg 171da2e6f9
avoid dependency on transitive includes - based on include-what-you-use (#3757) 2022-01-27 19:03:20 +01:00
Oliver Stöneberg 0ba9cb4e64
fixed some unusedFunction warnings (#3618) 2022-01-04 15:48:08 +01:00
Oliver Stöneberg 6739995e79
removed or annotated some code which is only used in test code (#3656) 2022-01-03 12:40:20 +01:00
Oliver Stöneberg ba402f3e50
cleaned up includes based on include-what-you-use (#3627) 2021-12-15 19:47:27 +01:00
Paul Fultz II 13f5b560ce
Fix 10555: FP knownConditionTrueFalse with non-const function in base class (#3559) 2021-11-12 20:05:43 +01:00
chrchr-github 629f883408
Fix #10097: autovarInvalidDeallocation with pointer to std::array (#3529) 2021-11-08 20:31:16 +01:00
Ken-Patrick Lehrmann b3b3b6b2a1
Fix handling of namespace scope with several bodystarts (#3438)
Follow up to 0093452bed.
Give the proper end to getVariableList, since it might not be bodyEnd.

Before that, getVariableList would add the same variables in several
unrelated scopes, and all kind of false positive would follow.

For instance, with the case I added in the unit-tests, I had:
```
../code.cpp:15:18: warning: The struct 'is_A' defines member variable with name 'foo' also defined in its parent struct 'is_A_impl'. [duplInheritedMember]
static const int foo = 8;
                 ^
../code.cpp:15:18: note: Parent variable 'is_A_impl::foo'
static const int foo = 8;
                 ^
../code.cpp:15:18: note: Derived variable 'is_A::foo'
static const int foo = 8;
                 ^
../code.cpp:15:18: style: struct member 'has_A::foo' is never used. [unusedStructMember]
static const int foo = 8;
                 ^
../code.cpp:15:18: style: struct member 'is_A::foo' is never used. [unusedStructMember]
static const int foo = 8;
                 ^
```
2021-09-04 11:09:33 +02:00
Paul Fultz II fdaeaacc40
Symboldatabase: Improve valuetypes for containers, iterators, and smart pointers (#3398) 2021-08-14 19:00:58 +02:00
Daniel Marjamäki 0093452bed SymbolDatabase; Better handling of namespace that is defined in several scopes 2021-08-10 07:00:11 +02:00
Paul Fultz II 7f358b2bed
Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
Paul Fultz II 00eb71fd49
Remove constexpr -> const simplification (#3346) 2021-07-22 07:22:26 +02:00
Daniel Marjamäki b1547a387e astyle formatting
[ci skip]
2021-07-21 20:13:38 +02:00
Paul Fultz II 8efe1d4ab4
Find reference to dangling unique ptr (#3344) 2021-07-20 21:30:27 +02:00
Daniel Marjamäki d1fe34e167 misra; implement rule 8.10 2021-07-18 21:18:07 +02:00
Paul Fultz II 59a1c1a9d8
Refactor: Remove variable analyzer (#3339) 2021-07-18 07:46:31 +02:00
Daniel Marjamäki 7cb66d56f3 missingReturn; fixed false positive with trailing return type 2021-07-08 13:50:26 +02:00
orbitcowboy a585834445 Running astyle [ci skip] 2021-06-03 07:35:50 +02:00
Paul Fultz II 3e78e76fe8
Fix issue 10076: ValueFlow: False positive after address of var is taken 'T t = {{{&var}}};' (#3283) 2021-06-03 07:31:46 +02:00
Paul Fultz II 31e3e4d87b
Fix issue 10086: false positive: (style) constVariable: Variable 'x' can be declared with const (#3219) 2021-04-30 17:47:08 +02:00
Daniel Marjamäki d2d2124238 Revert "Clang import; This experimental feature didn't "take off" much. After a lot of work we are still far fram the goal. I remove it now but don't rule out completely that it could ever be added again."
This reverts commit 207361b174.
2021-04-30 16:47:02 +02:00
Daniel Marjamäki 207361b174 Clang import; This experimental feature didn't "take off" much. After a lot of work we are still far fram the goal. I remove it now but don't rule out completely that it could ever be added again. 2021-04-21 18:59:48 +02:00
Oliver Stöneberg 6397e29f84
cleaned up includes based on include-what-you-use (#3141) 2021-04-03 21:30:50 +02:00
Daniel Marjamäki 42437277dc Update Copyright year 2021-03-21 20:58:32 +01:00
Daniel Marjamäki b2691bda88 Fixed false positive in self check 2021-03-20 18:54:46 +01:00
Daniel Marjamäki 1151c3dafd Fixed msvc compilation error by implementing Variable::operator= 2021-01-28 13:46:15 +01:00
Daniel Marjamäki dc230d18ef Try to fix Cppcheck self-check warnings 2021-01-28 12:36:31 +01:00
Daniel Marjamäki 203d6ebe5a Fixed #10100 (FP: shadowVariable clangimport) 2021-01-27 20:03:42 +01:00
orbitcowboy bb451ca289 Running astlye [ci skip] 2021-01-22 21:47:24 +01:00
Paul Fultz II 8b26ecbcdd
Extend ProgramMemory to handle expressions (#3069) 2021-01-21 19:49:37 +01:00
IOBYTE fde5994cc3
fix #10061 (debug: Executable scope 'x' with unknown function.) (#3062) 2021-01-18 19:01:04 +01:00
Daniel Marjamäki 168db9351d ClangImport; set exprid 2021-01-06 11:03:43 +01:00
Oliver Stöneberg 20e462a8ed
split "varid0" from more generic "debug" messages (#2997) 2020-12-31 19:24:16 +01:00
Daniel Marjamäki 8bd783f820 Refactoring; Added findBreakScope and Scope::isLoopScope() 2020-12-24 22:58:31 +01:00
Daniel Marjamäki 8b52ed590e Clang import: Better handling of const methods 2020-11-09 14:50:34 +01:00
Daniel Marjamäki 8956ecb5fc Clang import: Fixed data for inline static functions 2020-11-03 17:52:53 +01:00
Daniel Marjamäki e053066d8b Clang import: Fixed Variable::mTypeStartToken and Variable::mTypeEndToken for unnamed parameters 2020-11-02 20:58:43 +01:00
Daniel Marjamäki 6de91d6386 Fixed #9707 (False positive: unreadVariable, union) 2020-10-02 20:22:22 +02:00
Daniel Marjamäki 514b7f4da4 Fixed #9906 (False positive: constParameter (function pointer)) 2020-09-23 22:10:47 +02:00
Daniel Marjamäki f052d32e31 astyle formatting 2020-09-10 08:02:45 +02:00
Paul Fultz II 34d65e25d6
Merge branch 'main' into lifetime-subfunction 2020-09-09 12:02:02 -05:00
Daniel Marjamäki 687b44dbb7 Token: add flag for splitted variable declaration with initialization 2020-09-09 16:22:47 +02:00
Paul 786672e19d Format 2020-09-06 21:59:21 -05:00
Paul c7a5d3c5f1 Fix FPs 2020-09-06 21:58:36 -05:00
Daniel Marjamäki 5acd6fcdc8 astyle formatting 2020-09-03 18:55:40 +02:00