Commit Graph

701 Commits

Author SHA1 Message Date
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 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 cadb284a3d Refactored the AST checking of CheckOther::checkIncorrectLogicOperator() 2013-11-10 11:59:18 +01:00
Daniel Marjamäki b0ce42565e AST: Added experimental new implementations for CheckAssignIf::comparison, CheckOther::checkIncorrectLogicOperator and CheckOther::checkDuplicateExpression 2013-11-07 14:38:08 +01:00
Daniel Marjamäki fb04c8ff84 Fixed #5107 (redundantAssignment when pointer changes) 2013-11-04 23:46:07 +01:00
Daniel Marjamäki 06c5bd0daa Fixed #5128 (False positive zerodivcond 'a ? 1 / a : 0') 2013-10-30 16:51:00 +01:00
XhmikosR 32e2a5b879 test/testother.cpp: Fix a C4800 MSVC warning. 2013-10-25 18:14:16 +03:00
Daniel Marjamäki 364757e1e1 Fixed #5089 ('inconclusive' output printed although --inconclusive not specified) 2013-10-23 06:42:52 +02:00
Daniel Marjamäki d1b03d9c31 Fixed false positive for 'object is destroyed immediately' when there is no code after the object 2013-10-22 19:37:11 +02:00
Daniel Marjamäki a55056c770 Fixed #5105 (false positive: (warning) Either the condition 'b!=0' is useless or there is division by zero) 2013-10-22 16:18:42 +02:00
Daniel Marjamäki 5d7e0aebf4 Fixed #5084 (False positive: (style) Same expression on both sides of '&&') 2013-10-19 18:04:53 +02:00
Daniel Marjamäki 6aa03efa2f Fixed #5103 (Don't show 'The scope of the variable can be reduced' if there is no explicit block with { }) 2013-10-19 17:27:02 +02:00
Daniel Marjamäki 783bb6eb0b Test that there is no segfault in CheckOther::checkZeroDivisionOrUselessCondition when the SymbolDatabase is invalid. Ticket: #5045 2013-10-10 22:23:52 +02:00
orbitcowboy 6eaa2f2444 Tokenizer:simplifyMathFunctions: added support for acos[f|l] functions. 2013-10-09 07:59:32 -07:00
orbitcowboy 58c09f80b6 Testother: split up a large testfunction, no functional change. 2013-10-09 07:48:46 -07:00
Daniel Marjamäki 9ce7efc6e4 commaSeparatedReturn: made checking experimental for now because there are false positives (#5076) 2013-10-08 18:05:07 +02:00
Daniel Marjamäki 4cd0108b93 Fixed #4976 (False positive: (style) A pointer can not be negative (git/sha1_file.c)) 2013-10-06 16:52:27 +02:00
Daniel Marjamäki 973bdcc6d8 Fixed #4929 (false positive: Division by zero (standard function div())) 2013-09-29 11:13:49 +02:00
Martin Ettl 5aaaff46ee Fixed #5049: new check: (warning) Comparison of two identical variables with isgreater(result,result) evaluates always to false. 2013-09-26 07:07:48 +02:00
Daniel Marjamäki 17c0bb3cab revert 027e5cc8. the div() standard function should not be reimplemented. create a different fix. Ticket: #4929 2013-09-23 18:01:15 +02:00
Daniel Marjamäki 027e5cc860 Fixed #4929 (false positive: Division by zero (standard function div())) 2013-09-22 09:52:12 +02:00
Daniel Marjamäki 965d8f0ecc Fixed #5033 (segmentation fault (valid code) in CheckOther::checkZeroDivisionOrUselessCondition) 2013-09-21 17:44:25 +02:00
Daniel Marjamki 3de9431507 Fixed #5022 (Improve check: Division by zero or useless condition, function call) 2013-09-15 17:46:52 +02:00
Ettl Martin 5a671f8914 Fixed #5023 (Add support for asinf,acosf,asinl,acosl (...) functions) 2013-09-13 19:49:25 +02:00
Daniel Marjamäki 4b1254bc8d Merge pull request #168 from simartin/ticket_4994
Ticket #4994: Don't crash when checking variable scope for invalid input
2013-09-08 06:57:42 -07:00
Simon Martin 843833f907 Ticket #4994: Don't crash when checking variable scope for invalid input. 2013-09-07 21:16:25 +02:00
Daniel Marjamäki 6bb6506ce2 checkZeroDivisionOrUselessCondition: Fixed false positive when function is called and variable is passed to it 2013-09-07 16:18:11 +02:00
Daniel Marjamäki 83c460fc56 Fixed #5017 (New check: division by zero, otherwise condition is redundant) 2013-09-07 07:40:10 +02:00
Alexander Mai 7fc6b1344b Added testcases for #4801 (Cppcheck fails to parse Posix (crash in CheckOther::checkPipeParameterSize())) 2013-08-22 21:33:02 +02:00
Daniel Marjamäki 5d7f30b88f reassign var: better handling of struct members 2013-08-15 16:13:58 +02:00
PKEuS a9a5dc0354 Updated to AStyle 2.03, require this version 2013-08-07 16:27:37 +02:00
PKEuS dd82817752 Fixed #4943 and simplified CheckOther::checkCommaSeparatedReturn() 2013-08-06 11:27:09 -07:00
PKEuS 5e3ccda408 Added support for noreturn functions from library to CheckOther::checkUnreachableCode() 2013-08-06 02:11:59 -07:00
Alexander Mai 3e9f6daa00 Added test cases for #4801 (Cppcheck fails to parse Posix (crash in CheckOther::checkPipeParameterSize())) 2013-07-29 10:57:41 +02:00
Daniel Marjamäki 239a0819e3 astyle formatting 2013-07-28 13:17:46 +02:00
Simon Martin eb3bf571be Avoid divisions by zero when simplifying numeric calculations. 2013-07-28 12:32:18 +02:00
Alexander Mai 40fa474a5b Fixed #4927 (Segfault in CheckOther::checkCommaSeparatedReturn() on invalid code) 2013-07-28 10:39:58 +02:00
Daniel Marjamäki 178467a578 astyle formatting 2013-07-24 11:20:28 +02:00
Carlo Marcelo Arenas Belon aa0560fe3b Fixed #4925 (False positive: checkother style)
When using a variable that is assigned a function pointer checks for
pointers are triggered which would complain if used in arithmetic
comparisions (eventhough it will be valid code if the function returns
an int)
2013-07-24 08:22:24 +02:00
Lucas Manuel Rodriguez 7e556c215e Fixed #4861 (Improve check: object is destroyed immediately not detected when calling overloaded constructor) 2013-07-22 07:25:53 +02:00
Zachary Blair a381170886 Fixed #4874 (Minor spelling corrections) 2013-06-26 00:47:02 -07:00
Andreas Bießmann 9b3a8774c5 Test case for unreachableCode (#4756) 2013-06-18 06:40:43 +02:00
Daniel Marjamäki 2fb8133e90 Fixed #4862 (False positive: Comma is used in return statement (template)) 2013-06-18 00:13:45 +02:00
Abhishek Bharadwaj d85c8e6782 Fixed #4104 (New check: comma separated statements in return statement from a function) 2013-06-15 17:49:10 +02:00
PKEuS 4efccc2c5d Fixed #4420: Prefix increment is only suspicious, if its return value is not used. 2013-06-10 13:02:02 -07:00
Zachary Blair 28c0045f36 Fixed #4173: New check: arithmetical usage of inf/nan result 2013-06-09 23:13:08 -07:00
Frank Zingsheim d387e8b770 Fixed #4711: (false positive: Consecutive return...) 2013-05-11 17:50:59 +02:00