Commit Graph

931 Commits

Author SHA1 Message Date
PKEuS c0fc47643f Fixed false positive #5772: Use AST to check if modulo operation is preceded by an arithmetical operation. 2014-05-09 21:58:28 +02:00
Daniel Marjamäki cb43bee10d Same expression: don't warn for same expressions when there is assignment 2014-05-09 06:16:27 +02:00
Daniel Marjamäki b354de6b23 Fixed #5750 (FP:Opposite conditions in nested 'if' blocks lead to a dead code block) 2014-05-06 16:15:12 +02:00
Alexander Mai d3e8bbdc51 #5618 False positive: (performance) Use const reference for 'temp' to avoid unnecessary data copying. - redundantCopyLocalConst/CheckOther::checkRedundantCopy() is prone to false positives. As a quick fix that check becomes inconclusive. 2014-05-02 20:09:38 +02:00
orbitcowboy a6af8f5dcf #5748: Fixed FP (wrongmathcall) do not warn if an object calls a function foo.log(0). 2014-04-23 01:23:38 +02:00
Daniel Marjamäki fc24d491cc Fixed #5560 (false positive: C-style pointer casting) 2014-04-29 06:21:30 +02:00
PKEuS 866ab1ce14 Fixed false positive #5689: Care about usage of return values of memory functions 2014-04-27 12:18:33 +02:00
Daniel Marjamäki bde6698bcd Fixed #5731 (False positive with opposite conditions) 2014-04-27 10:21:20 +02:00
Daniel Marjamäki 7317785e32 astyle formatting
[ci skip]
2014-04-27 10:20:21 +02:00
Alexander Mai 17ec0af6a7 #5734 A FP literalWithCharPtrCompare was issued upon comparison with a char referenced within a string literal 2014-04-27 09:40:13 +02:00
Daniel Marjamäki d144197d7e Fixed segfault 2014-04-23 19:49:16 +02:00
Daniel Marjamäki 272fcc18d8 Don't warn about redundant number statement in '({ do_something(); 0; })' 2014-04-23 16:23:19 +02:00
Frank Zingsheim 87354bf9d2 Fixed #5707 (false negative: unreachable code is not detected (code after return)) 2014-04-23 07:58:43 +02:00
Daniel Marjamäki 3c5cf299e3 Fixed #5708 (Improve oppositeInnerCondition) 2014-04-23 07:57:13 +02:00
Alexander Mai ccba934cb1 #5684 The scope of the variable 'p' can be reduced - But it can not. 2014-04-17 21:32:56 +02:00
Daniel Marjamäki 8d5a9893d5 Fixed #5682 (False positive: (style) Same expression on both sides of '&&') 2014-04-16 16:04:46 +02:00
PKEuS 076f7a7542 Fixed some coverity findings about dead code, fixed a misleading comment 2014-04-14 22:46:51 +02:00
Philipp Kloke dfd9d32c4b Refactorization: Removed whitespaces at the end of a token
Removed a redundant 'void'
2014-04-12 23:41:46 +02:00
Philipp Kloke ddf34440b6 Refactorization: Replaced several Token::findmatch calls by symboldatabase usage 2014-04-12 23:41:46 +02:00
PKEuS 7ffc313748 Save "->" in Token::originalName if simplified to "."; Fix false positive #4890. 2014-04-12 12:04:56 +02:00
Philipp Kloke 1fafc7f4dc Refactorization: use MathLib::isNullValue in CheckOther::checkMemsetInvalid2ndParam(); Fixed it to support also float literals like "0.f" 2014-04-11 14:17:36 +02:00
Philipp Kloke cf30fab413 Refactorized inefficient usage of Token::findmatch in two checks in checkother.cpp 2014-04-11 14:17:35 +02:00
Philipp Kloke 20c3a5baf0 Refactorized switchCaseFallThrough: Removed lots of obsolete code 2014-04-11 14:17:35 +02:00
PKEuS c33498fa0b Fixed false positive redundantAssignment when operator() is called (#5568) 2014-04-10 21:56:30 +02:00
Daniel Marjamäki 0788e64eb8 Removed unused function expressionsHasSideEffects() 2014-04-04 07:04:19 +02:00
Daniel Marjamäki 8dcb3bae47 Refactoring checks of overlapping conditions in if and else-if 2014-04-03 19:35:50 +02:00
Daniel Marjamäki 1a83338faf Refactoring. Created utility function isOppositeCond() 2014-04-03 17:08:42 +02:00
Daniel Marjamäki 110f956029 code cleanup for invertOperatorForOperandSwap() 2014-04-03 16:22:07 +02:00
Daniel Marjamäki ffac614f7e Fix Cppcheck warning. Use reference to avoid redundant data-copy 2014-04-03 16:16:39 +02:00
Daniel Marjamäki 9f80f3a4e8 Small cleanups in the code 2014-04-03 06:37:02 +02:00
Daniel Marjamäki a115bbbbb5 Refactoring CheckOther::checkCharVariable() using AST 2014-04-03 06:27:29 +02:00
Daniel Marjamäki bc9bb17025 Refactor CheckOther::oppositeInnerCondition() using AST and isSameExpression() 2014-04-02 16:54:01 +02:00
Daniel Marjamäki 3c64c70ce2 ValueFlow: Added utility functions getValueLE and getValueGE to simplify usage 2014-04-02 06:49:28 +02:00
Daniel Marjamäki f4cdb2c46a CheckOther::checkCharVariable: Refactoring using AST 2014-04-01 19:16:06 +02:00
Daniel Marjamäki 348c26f59c fixed segmentation fault in case typeStartToken() returns 0 2014-03-29 21:01:21 +01:00
Daniel Marjamäki efc84ac310 Fix segmentation fault when checking build/tokenize.cpp 2014-03-29 20:41:17 +01:00
Daniel Marjamäki 407c9fdf9d Refactored checkNegativeBitwiseShift() so it uses ast and valueflow 2014-03-29 13:01:30 +01:00
Daniel Marjamäki 502ba95383 Simplification. Code 'else if ..' is simplified to 'else { if ..' 2014-03-28 18:21:56 +01:00
PKEuS 50a94885ce Fixed oppositeInnerCondition check:
- Resolved false positives #4170 and #4186, as well as numerous other potential false positives
- Improved message to point to both locations
- Inner condition could also be a while loop; Outer if could also be 'else if'
- Made the check non-experimental again (#3645)
2014-03-28 14:55:17 +01:00
PKEuS e8c7a723f5 Fixed five new true positives in cppcheck, silenced one new false positive (see #5618) 2014-03-27 15:50:30 +01:00
PKEuS b23aebf2f0 Show redundantCopyLocalConst for STL types (#4331) 2014-03-27 11:15:17 +01:00
PKEuS 5083dd4273 Fixed two visual studio warnings 2014-03-24 18:14:23 +01:00
PKEuS 8d5be8c4a4 Fixed related issues to #5601 2014-03-22 22:35:20 +01:00
PKEuS 58c2f372b9 Fixed false positive when noreturn function is defined (#5601, second attempt) 2014-03-22 19:55:13 +01:00
PKEuS 77c871035b Fixed false positive when noreturn function is defined (#5601) 2014-03-22 18:57:19 +01:00
Daniel Marjamäki 7d2357de8d Refactoring. Use astIsFloat() 2014-03-22 18:42:29 +01:00
Daniel Marjamäki 54e7f34f4a Fixed #5584 (FP: Division by zero when function not declared) 2014-03-20 16:12:58 +01:00
PKEuS 2568baa473 #5528: Raise duplicateExpressionError on operators /, % and -. 2014-03-17 18:35:36 +01:00
PKEuS fab6b56360 Improved check (#5553): Detect stricmp(var.c_str(), var.c_str()) 2014-03-17 17:41:45 +01:00
PKEuS ebd0b43c4f Fixed #5382: False positive "scope can be reduced" when initializing two-dimensional array. 2014-03-17 12:34:39 +01:00