59 Commits

Author SHA1 Message Date
PKEuS
f2ae295f1e Support char literals in CheckCondition::checkIncorrectLogicOperator() () 2016-05-24 15:08:48 +02:00
PKEuS
5d5886b464 Properly detect binary & in CheckCondition::clarifyCondition() (fixes false positives when self-checking cppcheck) 2016-05-06 17:39:41 +02:00
PKEuS
3366a74bb0 Refactorized CheckCondition::clarifyCondition():
- Reimplemented parts of the check based on ValueType
- Merged two loops

Fixed some type conversion messages
2016-05-06 15:22:45 +02:00
Bartlomiej Grzeskowiak
7e020e1d92 - fix for false negative: Statement is always false 2016-04-14 14:50:08 +02:00
Daniel Marjamäki
7bd034c009 Fixed (False positive knownConditionTrueFalse - assertions) 2016-02-06 14:37:44 +01:00
Daniel Marjamäki
40e14f401f CheckCondition::alwaysTrueFalse: Move to normal checking to catch more problems 2016-01-26 10:08:21 +01:00
Daniel Marjamäki
6faa637fc7 Fixed (False positive badBitmaskCheck - error in valueflow) 2016-01-24 13:45:44 +01:00
Lauri Nurmi
996c9244d8 Update copyright year to 2007-2016. 2016-01-01 15:34:45 +02:00
Daniel Marjamäki
1b0bb02f1d invalidTestForOverflow: Fixed some false negatives () 2015-11-30 11:12:51 +01:00
Daniel Marjamäki
fb8cce647c invalidTestForOverflow: Refactor; move from checkother to checkcondition 2015-11-30 08:51:15 +01:00
Daniel Marjamäki
0f9d90d2be Changed Copyrights. Removed my name. 2015-11-18 20:04:50 +01:00
Daniel Marjamäki
b9b0964dab Fixed (False positive Mismatching assignment and comparison (variable is changed in loop)) 2015-11-11 13:45:28 +01:00
Alexander Mai
2554674f4b Add regression test for previously fixed , and TODO test for 2015-11-07 11:17:44 +01:00
Daniel Marjamäki
ac9cb87e04 ValueType: Handle bit operations, sizeof better. Use ValueType in astIsFloat(). 2015-10-11 12:20:40 +02:00
PKEuS
0a34b206e8 Refactorization: Reduced code duplication in test suite 2015-10-08 11:35:51 +02:00
PKEuS
3a5cef8a7e Refactorization: Improved usage of Settings instances in test suite 2015-10-07 18:40:03 +02:00
Simon Martin
f273323cd0 Fixed TODO-test for CheckCondition::checkBadBitmaskCheck by handling functions return bool. 2015-09-03 21:07:03 +02:00
Daniel Marjamäki
6865724c4e Fixed (Token::expressionString: parenthesis missing in expression (*it)->stats.corpse_ticks) 2015-08-12 10:55:25 +02:00
Daniel Marjamäki
eda5272dfd Fixed (Improve 'Redundant condition' error message) 2015-08-05 11:15:54 +02:00
Matthias Krüger
73eefa46fc testcondition: update testcase that was added since I did the changes. 2015-07-31 15:31:43 +02:00
Matthias Krüger
87891b4128 CheckCondition::checkIncorrectLogicOperator put conditions in single quotes 2015-07-31 15:28:48 +02:00
Matthias Krüger
21ed807f8d CheckCondition::alwaysTrueFalseError: put condition in single quotes. 2015-07-31 15:28:37 +02:00
Daniel Marjamäki
251f6d2a15 Fixed (Token::expressionString: wrong output when first token is post-incremented) 2015-07-31 07:03:52 +02:00
Daniel Marjamäki
1752c4f4f0 Avoid 'Condition always true/false' FP when part of the condition is an expanded macro 2015-07-30 13:30:16 +02:00
amai2012
c5673612e2 False positive incorrectLogicOperator due to dynamic_cast. Run CheckCondition::checkIncorrectLogicOperator on non-simplified tokenlist. 2015-07-30 10:30:30 +02:00
Daniel Marjamäki
120f3072eb alwaysTrueFalse: Dont write warning when comparison is made in macro 2015-07-29 12:51:00 +02:00
Daniel Marjamäki
64b72bd6e5 Fixed (False positive (oppositeInnerCondition) - if (!dynamic_cast<>)) 2015-07-27 10:43:52 +02:00
PKEuS
176b3925b3 Removed "verify" code in testrunner. Fixing its messages reduces the accuracy of the test suite. 2015-07-25 14:18:41 +02:00
Daniel Marjamäki
f711520892 Fixed (false negative: logical conjunction 'x == 0') 2015-07-21 22:26:22 +02:00
Daniel Marjamäki
1b8252181d Tokenizer: Removed Tokenizer::simplifyIfNotNull () 2015-07-21 17:58:44 +02:00
Daniel Marjamäki
cb04dfbd37 Fixed (condition is always true (variable is assigned constant value and then used in condition)) 2015-07-17 15:30:23 +02:00
Daniel Marjamäki
15a8e4d2df Temporarily revert "Fixed (condition is always true (variable is assigned constant value and then used in condition))"
This reverts commit a3fbad50cb2d21d88f51b105a73ef89773dfda6b.

The ValueFlow must be updated before this can be re-added.
2015-07-16 21:10:46 +02:00
Daniel Marjamäki
a3fbad50cb Fixed (condition is always true (variable is assigned constant value and then used in condition)) 2015-07-16 20:17:57 +02:00
orbitcowboy
1d910bc3bc : Added test case for oppositeInnerCondition. 2015-07-16 08:44:38 +02:00
Daniel Marjamäki
1a872a2c9f Fixed (false negative: Expression is always true/false '!(v!=10) && !(v!=20)') 2015-07-13 20:53:49 +02:00
Alexander Mai
6e03e7dca2 Remove some code checking for invalid class hierarchy which got obsolete since 480a5672b046ef0017af8bf59b6284895c22123d. Run astyle 2015-07-01 07:50:13 +02:00
amai2012
108b035af2 Adjust two checks which have different results on Windows/Visual Studio than on Linux: one succeeds already, another fails. Analysis/fix is under development. Temporary repair allows to detect further regressions. 2015-06-30 21:21:26 +02:00
Daniel Marjamäki
1d49334398 Fixed (False positive assignIfError (assignment in while condition)) 2015-06-20 16:23:16 +02:00
Alexander Mai
272cc55ab8 False positive: redundantCondition - comparing large integer values (unsigned long long). Testcase added, issue got fixed before. 2015-06-20 12:18:24 +02:00
Daniel Marjamäki
af4a4663e2 Fixed (False positive redundantCondition - !(i>1) is not i<1) 2015-06-19 19:49:05 +02:00
Daniel Marjamäki
1e1ba6b4a9 Fixed (False positive oppositeInnerCondition - unknown variable) 2015-06-14 20:06:05 +02:00
Alexander Mai
a7b82b5c28 Refactoring to address some issues from (handling of unsigned numbers). Also adding a TODO testcase since the real issue (FP) is still not fixed 2015-06-13 18:08:13 +02:00
Dmitry-Me
cae605b1ec New warning: warn about redundant code in condition. 2015-06-10 18:53:55 +02:00
PKEuS
bc5132e0ac Refactorization: Moved declaration of errout, ... to testsuite.h, uniformized style 2015-03-11 22:54:43 +01:00
Alexander Mai
b9cc5b5c6b crash: CheckCondition::checkBadBitmaskCheck ; wine dlls/gdi32/dibdrv/primitives.c. Run astyle. 2015-02-23 22:06:55 +01:00
PKEuS
bedc935ab0 New check: Warn about constant expression if ( unknown | non_null_constant) () 2015-02-22 13:09:39 +01:00
Daniel Marjamäki
eec938dbad Fixed (False positive: Incorrect detection of (assignment + comparison) inside for-clause) 2015-02-05 20:17:30 +01:00
Daniel Marjamäki
d6c94e3828 isOppositeCond: Fixed FN 2015-02-01 13:03:38 +01:00
Daniel Marjamäki
d091639080 Fixed (False positive multiCondition) 2015-02-01 12:58:06 +01:00
PKEuS
21cb0cfd60 Take simplifyIfNotNull and simplifyIfNot out of simplifyTokenList1 (first step for ) 2015-01-31 20:12:02 +01:00