Commit Graph

364 Commits

Author SHA1 Message Date
chrchr-github 5cc8ef7e87
Add test for ()
* Add test for 

* Add test for 

* Revert
2022-08-20 19:23:55 +02:00
Oliver Stöneberg 1b4141cbe5
added more missing `sstream` includes () 2022-08-19 18:23:15 +02:00
chrchr-github bdbd84ba98
: Fix regression ()
* Fix  FP knownConditionTrueFalse with constexpr?

* Modify isConstVarExpression()

* Use predicate

* Format

* : Fix regression
2022-08-09 13:13:16 +02:00
chrchr-github 078a6d7804
Fix FP knownConditionTrueFalse with constexpr? () 2022-08-07 19:06:19 +02:00
chrchr-github 0eabe0505b
Handle float values () 2022-08-02 22:11:31 +02:00
chrchr-github bc409776e3
Fix Wrong redundant condition: misleading/wrong message ()
* Fix  Wrong redundant condition: misleading/wrong message

* Use expressionString()

* Clarify condition

* Update testcondition.cpp

* Trigger CI
2022-08-02 18:31:02 +02:00
chrchr-github 92d569afb6
FP: knownConditionTrueFalse (wrong message text) ()
*  FP: knownConditionTrueFalse (wrong message text)

* Format

* Update testcondition.cpp

* Trigger CI
2022-08-02 18:18:46 +02:00
Daniel Marjamäki 898ad314ab badBitmaskCheck: Avoid FP when there is #ifdef in expression 2022-07-28 21:56:05 +02:00
chrchr-github 5342e2cd03
Fix FP knownConditionTrueFalse with dynamic_cast () 2022-07-20 20:48:17 +02:00
chrchr-github 6dc606fd6a
Add tests for , , () 2022-07-18 18:03:08 +02:00
chrchr-github 9e74da6126
Fix FP compare with negated constant () 2022-07-16 07:28:15 +02:00
chrchr-github 596f75e2af
Fix FP compareValueOutOfTypeRangeError ()
* Fix FP compareValueOutOfTypeRangeError

* Remove suppressions
2022-07-01 10:48:32 +02:00
Paul Fultz II 8945c151f5
Fix 11124: FP knownConditionTrueFalse with fruit ()
* Update valueType

* Allow comparisons

* Fix compare op

* Add test

* Format

* Fix FP

* Format
2022-06-11 11:02:04 +02:00
Paul Fultz II 653a1ea83e
Fix 11100: FP knownConditionTrueFalse with getter/setter member functions ()
* Fix 11100: FP knownConditionTrueFalse with getter/setter member functions

* Format
2022-06-11 11:00:40 +02:00
chrchr-github 51c8630bb3
Fix FP knownConditionTrueFalse with virtual function ()
* Fix  FP knownConditionTrueFalse with virtual function

* Remove redundant check
2022-06-10 20:17:57 +02:00
chrchr-github b80d06b69e
Don't warn for 'x | MACRO' when MACRO is 0 () 2022-06-07 21:13:31 +02:00
chrchr-github 52453947c8
Don't warn for 'x | 0' in macro ()
* Fix  FN badBitmaskCheck for binary or with 0

* Add test for 

* Don't warn for 'x | 0' in macro

* Add test for 
2022-06-06 11:17:36 +02:00
chrchr-github f962436826
Fix FN badBitmaskCheck for binary or with 0 ()
* Fix  FN badBitmaskCheck for binary or with 0

* Add test for 
2022-06-04 17:25:10 +02:00
orbitcowboy c30333425b Added a regression test for ticket - FN: knownConditionTrueFalse 2022-05-24 09:21:21 +02:00
chrchr-github 2a7f00cf9a
Fix FN Condition '...' is always true ' uint16_t i; ( i <= 0xFFFF)' () 2022-05-21 08:33:42 +02:00
chrchr-github 63a1698335
Fix FP multiCondition when variable is assigned in if/else () 2022-05-11 20:01:13 +02:00
chrchr-github ad547af6f9
Add tests for , , ()
* Add tests for , 

* Add test for 

* Add tests for , 

* Add test for 

* Comment
2022-05-10 18:25:01 +02:00
chrchr-github 16ef2c1838
Add test for ()
* Add tests for , 

* Add test for 
2022-05-09 20:26:15 +02:00
chrchr-github 8c0561a78b
Add tests for , () 2022-05-09 14:52:31 +02:00
chrchr-github 509e42afd4
Fix FN duplicateCondition with struct member ()
* Fix  FN duplicateCondition with struct member

* Update testcondition.cpp
2022-05-03 19:57:30 +02:00
Paul Fultz II 4e7125554f
Fix 8358: FP: Condition '(number*0)!=0' is always false () 2022-04-30 09:35:51 +02:00
Paul Fultz II aafd1e10be
Fix 11006: FP uninitvar with unknown constant () 2022-04-28 10:48:37 +02:00
chrchr-github da1e2b22be
Add some tests ()
* Test for 

* Test for 

* Test for 

* Test for 

* Fix test case
2022-04-13 12:25:53 +02:00
chrchr-github 28a024ac4a
Fix incorrectLogicOperator/knownConditionTrueFalse for constexpr () 2022-04-11 20:42:54 +02:00
chrchr-github 2bccde0e3b
Fix FP Logical condition considered always false () 2022-04-09 14:09:10 +02:00
chrchr-github 52b4aeb279
Fix FP knownConditionTrueFalse with double to int cast () 2022-04-07 10:42:57 +02:00
Paul Fultz II 74667d1e2a
Fix 10418: false negative: knownConditionTrueFalse ()
* Improve handling inverted condition

* Fix tests

* Rename variables for clarity

* Add initial test

* Add another test

* Format

* Fix FP
2022-04-07 06:48:13 +02:00
Paul Fultz II 4fde7f8b18
Fix 10449: Regression: knownConditionTrueFalse (strlen/wcslen) ()
* Refactor library function usage

* Evaluate library function in program memory

* Fix and add tests

* Format
2022-04-06 06:35:38 +02:00
Paul Fultz II 0547cbcd26
Fix 10647: FN knownConditionTrueFalse for impossible Boolean value ()
* Add impossible values for bool

* Fix valueflow tests

* Fix assertion failure

* Add test

* Format
2022-04-03 20:04:05 +02:00
chrchr-github 3faff5e9fc
Fix FP knownConditionTrueFalse static variable with direct initialization () 2022-03-22 07:24:40 +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
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
Oliver Stöneberg f32583e097
removed OVERRIDE and FINAL defines and use the keywords directly () 2022-02-10 23:02:24 +01:00
Daniel Marjamäki 3989408738 Update copyright year 2022-02-05 11:45:17 +01:00
chrchr-github a20465eaea
Fix FP knownConditionTrueFalse with static variable and direct initialization / partial fix for () 2022-02-02 22:30:49 +01:00
Oliver Stöneberg 171da2e6f9
avoid dependency on transitive includes - based on include-what-you-use () 2022-01-27 19:03:20 +01:00
chrchr-github 7f9ef8c321
Add test cases for , , ()
* Add test case for  and 

* Add test case for ##9256
2022-01-20 16:15:38 +01:00
Paul Fultz II 71a44395c8
Fix 10659: FP knownConditionTrueFalse - C++17 structured binding () 2022-01-02 08:14:50 +01:00
Paul Fultz II 0c952ca05d
Fix 10223: ValueFlow; known value for a volatile variable () 2022-01-01 23:15:14 +01:00
Paul Fultz II 73f24b43f9
Fix 10437: FP knownConditionTrueFalse after pointer check () 2021-12-20 07:28:40 +01:00
chrchr-github 8df25ec4e9
Fix identicalConditionAfterEarlyExit variable modified in if-clause () 2021-12-18 22:52:54 +01:00
Paul Fultz II 5414814238
Fix 10649: False positive: wrong known value after reassignment () 2021-12-15 19:37:25 +01:00
Paul Fultz II 5f73af0d0e
Fix 10625: False positive: known value below do while () 2021-12-15 19:32:14 +01:00
chrchr-github 532477cdb2
Fix FP knownConditionTrueFalse (bitshift) () 2021-12-14 07:30:57 +01:00
Paul Fultz II c14920218c
Fix 10624: FP knownConditionTrueFalse with pointer member and dynamic cast () 2021-12-04 08:54:24 +01:00