Commit Graph

11391 Commits

Author SHA1 Message Date
Paul Fultz II 40ff9edad6
Fix 10843: FP: danglingTemporaryLifetime ()
* Fix 10843: FP: danglingTemporaryLifetime

* Format
2022-03-16 17:11:49 +01:00
chrchr-github fb1170b10b
Fix FP constStatement with variable called std () 2022-03-16 15:29:34 +01:00
chrchr-github b8ba0ae00e
Fix FP constStatement with ternary and comma operator () 2022-03-16 15:28:59 +01:00
Georgi D. Sotirov 33315b0ae5
Replace tinyxml2_LIBRARY with tinyxml2_LIBRARIES () 2022-03-15 21:17:03 +01:00
chrchr-github 1aff160411
Fix FP uninitvar after lambda expression ()
* Fix  FP uninitvar after lambda expression

* Format
2022-03-15 14:32:33 +01:00
chrchr-github f90a93591f
Add tests for , ()
* Add test for 

* Add test for 

* Format
2022-03-15 12:54:19 +01:00
chrchr-github 200b098471
Fix FP for unused private function if address of function is taken () 2022-03-14 19:15:48 +01:00
chrchr-github 6376bac5bb
Fix syntaxError with typedef and lambda ()
* Fix  syntaxError with typedef and lambda

* Don't insert union into template argument list, add test

* Format

* Revert "Format"

This reverts commit 8c52d49c8b.

* Format
2022-03-14 17:59:29 +01:00
chrchr-github d3d40fd599
Fix #10868/#10869 FN: constStatement, handle unused character constants ()
* Fix  FN: constStatement, handle unused character constants

* simpleMatch

* Fix  FN: constStatement

* Format
2022-03-14 14:14:32 +01:00
chrchr-github 2eed660b32
Fix Clarify warnings for uninitMemberVar () 2022-03-13 17:33:31 +01:00
chrchr-github 190506db40
Fix Regression: unusedStructMember ()
* Fix  Regression: unusedStructMember

* Add test for 

* simpleMatch
2022-03-13 06:27:17 +01:00
chrchr-github c3506b5186
Fix regressions with static variables and multiple assignments ()
* Fix regressions with static variables and multiple assignments

* Fix test

* Fix test cases
2022-03-13 06:26:21 +01:00
chrchr-github 3df170c191
Fix FN: constStatementError, streamline error messages () 2022-03-12 14:52:18 +01:00
chrchr-github d1f740a289
Partial fix for varid 0 with lambda (II) ()
* Partial fix for  varid 0 with lamba

* Format

* Undo

* Undo

* Partial fix for  varid 0 with lambda (II)
2022-03-12 06:17:37 +01:00
chrchr-github 4c85ac0d7b
Fix FP unused struct member (inner struct in C code) ()
* Fix  FP unused struct member (inner struct in C code)

* Redundant findType() call, add test
2022-03-12 06:16:29 +01:00
Paul Fultz II ff902369e0
Fix 10851: False positive: known variable value below for loop ()
* Fix 10851: False positive: known variable value below for loop

* Format

* Add test for 10863

* Format
2022-03-12 06:15:35 +01:00
chrchr-github 705931266c
constStatementError: don't warn for casts with possible side effects,… ()
* constStatementError: don't warn for casts with possible side effects, handle bool constants

* Recursive call, add tests

* Restore test

* Don't warn for C++ casts to void

* Don't warn for cast to void*
2022-03-11 21:45:51 +01:00
chrchr-github ffd9f9a93f
Fix FP missingOverride with unnamed parameters () 2022-03-11 21:44:13 +01:00
Binho 8b3647edd7 Fix false positive in memory leak 2022-03-10 08:29:05 +01:00
chrchr-github 2616046461
Partial fix for FP: unusedStructMember () 2022-03-09 20:25:58 +01:00
chrchr-github 557263acde
Partial fix for FP: unusedStructMember (II) ()
* Preliminary

* Fix member search, add tests
2022-03-09 18:22:30 +01:00
chrchr-github 850ad0fed9
: Add error message for unused casts, log unhandled errors ()
* : Add error message for unused casts, log unhandled errors

* Fix TODO

* Fix TODO
2022-03-09 18:21:47 +01:00
chrchr-github c9f47dec8b
Partial fix for varid 0 with lambda () 2022-03-08 20:10:51 +01:00
chrchr-github fbdfb60809
Warn about buffer overruns when allocating memory with new ()
* Warn about buffer overruns when allocating memory with new

* Format

* Avoid FP
2022-03-07 19:43:40 +01:00
chrchr-github 25360d5e4c
Add test for ()
* Add test for 

* Format
2022-03-07 15:32:14 +01:00
chrchr-github 461d797094
Add test for () 2022-03-07 10:44:46 +01:00
orbitcowboy 1d2beb0431 Added a regression test for ticket 6928 - Improve check: unused variables, goto 2022-03-07 10:12:57 +01:00
chrchr-github 3a5931b417
Fix C++11 default values not for all class fields and missing constructor () 2022-03-07 08:39:19 +01:00
chrchr-github 7f682d544e
Partial fix for FN buffer access out of bounds: std::vector ()
* Fix  FN: stlOutOfBounds (off by one)

* Format

* Simplify

* Partial fix for  FN buffer access out of bounds: std::vector

* Undo

* Format

* Fix test case
2022-03-06 07:41:09 +01:00
chrchr-github 0b0a8cad39
Fix FP unreadVariable within a macro (regression) ()
* Fix  FP unreadVariable within a macro (regression)

* Format

* Format
2022-03-05 08:14:57 +01:00
chrchr-github 27baa20f38
Fix FN: stlOutOfBounds (off by one) ()
* Fix  FN: stlOutOfBounds (off by one)

* Format

* Simplify
2022-03-04 17:13:13 +01:00
chrchr-github 2dd6c75b35
Fix Crash/nullptr deref in getEndOfExprScope() ()
* Fix  Crash/nullptr deref in getEndOfExprScope()

* Format
2022-03-03 17:08:23 +01:00
chrchr-github 78dd29ada3
Fix FP noConstructor with function pointer member () 2022-03-03 13:56:24 +01:00
chrchr-github 8a7992c6ac
Suppress operatorEqVarError for known non-copyable types ()
* Fix FP operatorEqVarError with class hierarchy

* Suppress operatorEqVarError for std::mutex

* Add test, non-copyable Qt types

* Update cppcheck-cfg.rng
2022-03-03 09:41:26 +01:00
Daniel Marjamäki 915ae4b845 ValueFlow: Fix crash 2022-03-02 21:12:37 +01:00
chrchr-github 9c50136571
Fix FN unreadVariable for pointer assignment when destructor exists (regression) ()
* Fix  FN unreadVariable for pointer assignment when destructor exists (regression)

* unused variable

* Issue warning for missing cfg

* Format
2022-03-02 11:11:44 +01:00
Oliver Stöneberg de728f472c
removed ThreadExecutor::addFileContent() () 2022-03-02 11:10:29 +01:00
Oliver Stöneberg 4a63af02ed
enabled functionConst and functionStatic in selfcheck ()
* 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 8e8e6b1170
Fix FP operatorEqVarError with class hierarchy () 2022-03-02 07:46:23 +01:00
chrchr-github 01de8256ea
Fix cppcheckError with enum class and typedefs ()
* Fix  cppcheckError with enum class and typedefs

* Format

* Format

* Leave enum class scope

* Remove comment
2022-03-02 07:46:15 +01:00
chrchr-github 43fb3dd047
Fix regression: wrong varid with using namespace ()
* Fix  missing varId with using namespace

* Undo

* Fix test

* Limit namespace candidates, duplicateBranch

* rvalue ref

* Undo

* Undo

* Undo

* Format

* Fix condition

* Fix regression: wrong varid with using namespace
2022-03-02 07:46:04 +01:00
Paul Fultz II 0b310b9d07
Fix 10702: FP knownConditionTrueFalse - Member variable modified ()
* Fix 10702: FP knownConditionTrueFalse - Member variable modified

* Format

* Make parameter const

* Fix FP

* Fix FP

* Update

* Format
2022-02-28 18:54:55 +01:00
chrchr-github 6a8bd981b5
Fix CheckClass::isMemberVar found used member variable with varid 0 ()
* Fix  CheckClass::isMemberVar found used member variable with varid 0

* Restore call to simpleMatch()
2022-02-28 18:28:23 +01:00
chrchr-github 05a6d09c5f
Fix FP uninitMemberVar from copy constructor [inconclusive] () 2022-02-27 19:15:19 +01:00
chrchr-github ddb0a8bb0b
Fix missing varId with using namespace ()
* Fix  missing varId with using namespace

* Undo

* Fix test

* Limit namespace candidates, duplicateBranch

* rvalue ref

* Undo

* Undo

* Undo

* Format

* Fix condition
2022-02-27 09:03:24 +01:00
chrchr-github d79d6e60db
Fix Internal error. Token::Match called with varid 0 ()
* Fix  Internal error. Token::Match called with varid 0

* Fix test
2022-02-26 23:48:29 +01:00
chrchr-github 441b437cea
Fix FN: unusedStructMember () 2022-02-26 18:53:00 +01:00
Paul Fultz II dbc80787e1
Fix 10821: FN: containerOutOfBounds ()
* Fix 10821: FN: containerOutOfBounds

* Format

* Fix cppcheck warning

* Add valueflow tests

* Format

* Fix some bugs

* Format
2022-02-25 05:53:51 +01:00
chrchr-github f53793c413
Fix FP cstyleCast with function pointer and calling convention () 2022-02-23 09:12:14 +01:00
Oliver Stöneberg 51371f7929
added CMake option USE_THREADS to be able to use threads instead of fork() / cleanups () 2022-02-23 09:04:35 +01:00