Commit Graph

874 Commits

Author SHA1 Message Date
Alexander Mai 50a184c3e9 Fixed #5166 (segmentation fault (invalid code) in lib/checkother.cpp:329 ( void * f { } void b ( ) { * f } )) 2014-02-27 18:24:51 +01:00
Daniel Marjamäki 7dbfd67da3 Fixed #5493 (False positive: Found a statement that begins with numeric constant / string constant - in the presence of initialization list.) 2014-02-26 06:18:52 +01:00
Daniel Marjamäki 8dd7f02e45 Fixed #5381 (Some false positives that came up when using --enable=performance file.c) 2014-02-23 11:02:39 +01:00
Daniel Marjamäki d37359217c Merge pull request #241 from lanurmi/more-nullptr
Change some more 0 literals into nullptr.
2014-02-16 23:29:23 +01:00
Lauri Nurmi 70a67eaf85 Change some more 0 literals into nullptr. 2014-02-16 13:38:50 +02:00
Daniel Marjamäki fdcb325d70 DuplicateBranch: Made warning inconclusive since it's in most cases noise 2014-02-16 11:04:27 +01:00
Lucas Manuel Rodriguez 052840f8f5 Fixed #4818 (New check: Check memset() 2nd parameter) 2014-02-15 15:06:00 -03:00
Daniel Marjamäki fb5c2d4b48 use nullptr in lib/checkother.cpp 2014-02-15 08:46:28 +01:00
Daniel Marjamäki fd3a8a2a18 Update copyright 2014-02-15 07:45:39 +01:00
Daniel Marjamäki 486a3192c0 Fixed #5246 (false positive: (warning) Logical conjunction always evaluates to false: t > 0 && t < 1.) 2014-02-04 06:50:29 +01:00
Lucas Manuel Rodriguez ad0269eeeb Refactor checks using Variable::isStlType() 2014-01-30 01:26:48 -03:00
Daniel Marjamäki 69109784e8 value flow: cleanup usage of valueflow. utility function Token::getValue was added. 2014-01-20 06:49:45 +01:00
Daniel Marjamäki add84187cc CheckOther: Removed old zero division check 2014-01-20 06:31:13 +01:00
Daniel Marjamäki b2b5590f2b Refactoring: Moved astStringify to the Token class and renamed it to expressionString. This can often be useful when reporting error messages that contains source code. 2014-01-17 18:37:49 +01:00
Daniel Marjamäki 3facc06cb7 CheckOther: Removed non-valueflow check for division by possible zero before condition 2014-01-17 17:42:54 +01:00
Daniel Marjamäki ab866be03a Tokenizer: Move 'else if' simplification to tokenize 2014-01-12 17:47:02 +01:00
Daniel Marjamäki e3496080c8 Fixed #5334 (False positive: same expression on both sides of '||') 2014-01-12 07:40:56 +01:00
Daniel Marjamäki ceca6be22b Fixed #5334 (False positive: same expression on both sides of '||') 2014-01-11 15:15:01 +01:00
Daniel Marjamäki 39b47cc1e7 value flow: improved error message output for conditional division by zero 2014-01-06 10:51:17 +01:00
Daniel Marjamäki 0877adb542 astyle formatting 2014-01-05 21:12:32 +01:00
Daniel Marjamäki afaf1473a8 Value flow: refactorings, write debug warning if iterating too far 2014-01-05 20:06:46 +01:00
Daniel Marjamäki d8270c710a Add new experimental value flow analysis 2014-01-04 20:57:02 +01:00
Daniel Marjamäki 372c29c24e Fixed #5284 (duplicateExpression falsely reported by members of a union in some circumstances) 2014-01-02 16:58:07 +01:00
Daniel Marjamäki 4b72f01e99 clarify calculation: Fixed FP for 'a = (*p ? 1 : 2)' 2013-12-28 11:02:39 +01:00
Daniel Marjamäki 4c44e62159 AST: Refactored CheckOther::clarifyCalculation 2013-12-24 10:07:20 +01:00
Daniel Marjamäki 042d3afb80 CheckOther::checkDuplicateExpression: Readded warnings when there is a expression between the duplicate expressions 'X || Y || X' 2013-12-24 07:21:46 +01:00
Daniel Marjamäki ac30a84c3a Refactoring: Replaced CheckOther::checkCCTypeFunctions with configuration 2013-12-23 19:58:33 +01:00
Daniel Marjamäki 76b907fe65 Fixed #5252 (Improve check: use Library to validate function arguments in invalidFunctionUsage) 2013-12-23 10:06:45 +01:00
Daniel Marjamäki fdcb6634df Fixed #5190 (FP Use const reference to avoid data copying) 2013-12-14 08:46:18 +01:00
Daniel Marjamäki 08cd0cd0f7 CheckOther::checkDuplicateExpression: Added TODO comment to readd checking for duplicate separated expressions 2013-12-13 06:40:35 +01:00
Daniel Marjamäki 83066edec0 Code cleanup 2013-12-10 06:29:06 +01:00
Daniel Marjamäki 5ba02d2fdd AST: Always use AST 2013-12-09 18:06:19 +01:00
Daniel Marjamäki da540a3bb3 AST: Improved astIsFloat handling of expressions 2013-11-25 04:26:15 +01:00
Daniel Marjamäki abdf2bb9d4 AST: fixed isSameExpressions handling of ({..}) 2013-11-25 04:08:28 +01:00
Daniel Marjamäki 13cd0f41f6 AST: Fixed FP in isSameExpression when there are different casts 2013-11-24 15:17:08 +01:00
Daniel Marjamäki e8eeb90adb AST: Fixed 'same expression' false positives (git merge --squash s, <<, >>) 2013-11-20 16:18:09 +01:00
Daniel Marjamäki 27a40b10e1 AST/incorrectLogicOperator: Better handling of large doubles where x+1=>x 2013-11-20 06:33:34 +01:00
Daniel Marjamäki 4e003c392e AST: code cleanup. Remove unreachable 'break' after 'return' 2013-11-18 23:24:58 +01:00
Daniel Marjamäki 45ee3b0fba AST: Refactoring new checkIncorrectLogic checking 2013-11-18 23:09:14 +01:00
Daniel Marjamäki 033cb19656 Same expression: Don't write warnings for same expression on both sides of arithmetical operators 2013-11-17 17:21:39 +01:00
Daniel Marjamäki 5af2fe6e5b AST: improved 'incorrect logic' checking when there are nested expressions 2013-11-15 06:51:35 +01:00
Daniel Marjamäki d1721b9d1b AST: Improved 'same expression on both sides of operator' checking for nested operators 2013-11-15 06:35:46 +01:00
Daniel Marjamäki 203d3e916b Fixed #5173 (false positive Variable XX is reassigned a value before the old one has been used) 2013-11-14 16:10:00 +01:00
Daniel Marjamäki 1ecade2657 AST: don't warn about duplicate expressions around '+' operator. It might be more efficient than using for instance '*2' 2013-11-11 20:03:59 +01:00
Daniel Marjamäki 58d7caded1 AST: improved handling of casts 2013-11-11 16:39:34 +01:00
Daniel Marjamäki 4027848761 incorrectLogicOperator: fixed FP when comparing char values. improved handling of float comparisons. 2013-11-10 18:06:51 +01:00
Daniel Marjamäki 807f62520c Fixed crash caused by endless recursion in redundant assignments check 2013-11-10 17:20:40 +01:00
Alexander Mai 687aeb4f5f Fixed #5158 (segmentation fault (valid code)) 2013-11-10 16:22:52 +01:00
Daniel Marjamäki 4ed4d71b3c CheckOther::checkIncorrectLogicOperator(): cleanup 2013-11-10 14:24:09 +01:00
Daniel Marjamäki cadb284a3d Refactored the AST checking of CheckOther::checkIncorrectLogicOperator() 2013-11-10 11:59:18 +01:00