Commit Graph

105 Commits

Author SHA1 Message Date
Daniel Marjamäki db321c2617 CheckCondition: Fix FP when there is increment/decrement in condition (daca icu) 2017-09-10 22:58:05 +02:00
Daniel Marjamäki c34fdd1905 CheckCondition: Fix FP for undeclared variables (daca) 2017-09-10 22:30:41 +02:00
Daniel Marjamäki 899ad8479d CheckCondition: Fixed FP when condition contains global static variable 2017-09-08 15:44:56 +02:00
Daniel Marjamäki d9adb5432a astyle formatting
[ci skip]
2017-09-08 15:41:14 +02:00
Nekto89 9cbfa0e383 Fix #7803: false negative: condition is always true 'if (flags & A)' (#938) 2017-09-08 14:30:42 +02:00
Daniel Marjamäki 58db814d72 Rephraze /Same/Identical/ 2017-09-08 12:41:33 +02:00
Daniel Marjamäki 120d0f86d0 CheckCondition: Fix FP about same condition when switch case is used (daca) 2017-09-07 22:05:01 +02:00
Daniel Marjamäki f2d56363d3 CheckCondition: Fix TODO assertion 2017-09-06 22:53:36 +02:00
Daniel Marjamäki e0c7f7f8f2 CheckCondition: Fix FP when there are method calls in condition 2017-09-06 22:26:00 +02:00
Daniel Marjamäki 35736364f8 Fixed #8199 (false negative: (warning) Same condition '...', second condition is always false) 2017-09-05 22:45:28 +02:00
Daniel Marjamäki e5e6f37e41 Fixed #7405 (false positive: (warning) Opposite conditions in nested 'if' blocks lead to a dead code block.) 2017-09-05 22:03:29 +02:00
Daniel Marjamäki c1000998f0 CheckCondition: Fix FP found in daca results (ace) 2017-09-05 09:33:35 +02:00
Daniel Marjamäki d82805b7fe CheckCondition: Improved checking for same conditions 2017-09-04 22:40:34 +02:00
Daniel Marjamäki abae5e0156 Fixed #8198 (false positive: (warning) Same condition, second condition is always false) 2017-09-04 22:25:20 +02:00
Daniel Marjamäki ad494b996c TestCondition: break out tests to functions 2017-09-04 22:11:53 +02:00
Daniel Marjamäki d838dc2129 CheckCondition::multiCondition2: Fix FN for pointers 2017-09-04 15:58:22 +02:00
Daniel Marjamäki 9465dca583 CheckCondition: Fix FPs for aliased variables (daca) 2017-09-04 09:34:03 +02:00
Daniel Marjamäki ef4a7ba7f2 Fix FP in CheckCondition::multiCondition2 2017-09-03 14:46:37 +02:00
Daniel Marjamäki b9849d9e4e CheckCondition::multiCondition2: Handle loops better 2017-09-03 11:03:01 +02:00
Daniel Marjamäki 01e65d3e00 Improved CheckCondition::multiCondition2 so deeper bugs are found 2017-09-03 10:44:22 +02:00
Daniel Marjamäki f2ec5f24ce Fixed #5845 (new check: same condition after noreturn conditional code => second condition is always false) 2017-09-03 10:34:34 +02:00
Daniel Marjamäki 0b751dcc1b Opposite conditions: Better matching when outer condition uses && 2017-09-01 23:24:15 +02:00
Daniel Marjamäki 3b4f60fd21 Updated error message 2017-09-01 13:33:47 +02:00
Daniel Marjamäki 7fad1b9a36 Improved checking for opposite conditions 2017-08-31 22:53:21 +02:00
Daniel Marjamäki dce942197c Fixed #8186 (Inner condition always false inside for loop) 2017-08-31 16:00:12 +02:00
Daniel Marjamäki 255d0410a4 Fixed #8085 (Token::expressionString: unsigned long long) 2017-07-21 09:16:42 +02:00
Daniel Marjamäki 814d2ae2a4 Fixed #7028 (False positive: opposite conditions (const method modifies variable)) 2017-07-10 23:12:45 +02:00
Ayaz Salikhov 28aa939d69 iwyu - include what you use 2017-05-27 04:33:47 +02:00
Daniel Marjamäki 040d2f0012 Use simplecpp lexer in test cases 2017-05-18 21:52:31 +02:00
Daniel Marjamäki 55cd69e290 alwaysTrueFalse: Dont warn when checking sizeof for some type. such condition might be platform dependent. 2017-05-13 19:07:24 +02:00
Daniel Marjamäki 7fd04cd8d0 Updated Token::expressionString(), write '->' instead of '.' 2017-04-30 14:22:18 +02:00
PKEuS 9225bff31d Added (back) support for enums to CheckCondition::checkIncorrectLogicOperator() (#7794) 2017-03-23 18:57:48 +01:00
PKEuS ca3e3b3cdb Fixed false positive multiCondition when & is used in both conditions (#7827) 2017-03-15 19:37:14 +01:00
Daniel Marjamäki 263c3596d5 known conditions: dont warn about 0 or 1 conditions as those look intentional 2017-03-08 18:39:19 +01:00
Daniel Marjamäki 1c6c209353 Fixed #7890 (1.77 false positive from knownConditionTrueFalse with function-like macros) 2017-03-03 19:53:16 +01:00
Daniel Marjamäki 16c06e5714 Fixed #7588 (Opposite conditions in nested 'if' blocks lead to a dead code block.) 2017-02-28 18:46:28 +01:00
Daniel Marjamäki a53f14da25 Fixed #7925 (False Positive identical condition) 2017-02-22 21:13:36 +01:00
Stefan Weil 57b57428c2 Fix some typos in comments (found by codespell)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-11-27 11:40:42 +01:00
Matthias Krüger cf24ea5221 fix #7783: false positive knownConditionTrueFalse on assert(0 && "message"). 2016-11-23 21:54:38 +01:00
Frank Zingsheim d4f01583b6 Fixed TODO (check if function parameter is non-const reference etc..) by common function 2016-11-01 14:06:30 +01:00
Harald Scheidl 58eb644003 Improved Check: Warn about number and char literals in boolean expressions (#7750) 2016-10-09 13:21:00 +02:00
Daniel Marjamäki 9417425829 Fix testrunner 2016-08-29 04:26:27 +02:00
Bartlomiej Grzeskowiak 09a83f2cc8 Fixed #7567 ("(a | 7) > 6U" is always true) 2016-08-07 16:58:39 +02:00
Daniel Marjamäki 5611a71820 Fixed #7543 (False positive boolean result used in bitwise operation) 2016-07-29 18:46:43 +02:00
Daniel Marjamäki 89be630156 Fixed #7543 (False positive boolean result used in bitwise operation) 2016-07-29 17:24:22 +02:00
Bartlomiej Grzeskowiak a5cfa2b12c - #7522 and #7428 revisited. ((a&7)>7U) is always false and ((X|7)>=6) is correct (X can be negative). 2016-06-17 12:12:53 +02:00
PKEuS f2ae295f1e Support char literals in CheckCondition::checkIncorrectLogicOperator() (#5912) 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 #7428 false negative: Statement is always false 2016-04-14 14:50:08 +02:00