Commit Graph

7955 Commits

Author SHA1 Message Date
PKEuS e77f348d82 New check: Suggest to use initialization list instead of assignment in constructor. (#489) 2012-05-18 07:54:58 -07:00
PKEuS 77927583f4 Fixed two compiler warnings spotted by edward-san (one of them was a real bug) 2012-05-17 08:29:32 -07:00
PKEuS a9cfe2814a Made some functions const according to cppcheck results 2012-05-17 02:54:17 -07:00
PKEuS 4825f78663 Fixed #2477 and #2669 2012-05-17 02:15:21 -07:00
PKEuS 3f5712bfb8 Fixed false positive "Function can be const" when 'this' is passed to a Memberfunction 2012-05-17 01:49:52 -07:00
PKEuS 4bb2a1b27b Made some functions static or const according to cppcheck results 2012-05-17 01:33:24 -07:00
PKEuS ea601ef2b0 Fixed false positives about const correctness caused by incorrect handling of default arguments 2012-05-17 01:05:36 -07:00
Daniel Marjamäki f803a18d50 Fixed #3749 (false positive: same expression on both sides of operator) 2012-05-17 07:26:57 +02:00
Daniel Marjamäki 505aa6e4cc TestSimplifyTokens::enum29: Fixed crash 2012-05-16 21:39:26 +02:00
PKEuS 6a05ad1cf8 Improved fix for #2698 and added test case 2012-05-16 12:36:05 -07:00
PKEuS 77df633904 Improved handling of function calls in const correctness check: Fixed #2702, #2698, #2729. 2012-05-16 11:57:12 -07:00
Daniel Marjamäki 0bb0fdedc2 Fixed #3747 (False 'boolean result in bitwise' message with 'mask' enums) 2012-05-16 18:48:33 +02:00
PKEuS c976325086 Refactorizations in test suite:
- Implement createOnly mode in givenACodeSampleToTokenize so that only createTokens is called instead of tokenize
-> Ensures that no simplifications are done which could make the testing basic functions (like Token::Match) less accurate. We often don't need this simplifications in testtoken.cpp.
-> Ensures that no validation of the source is done (Fix #2104)
- reduced overhead of givenACodeSampleToTokenize: Don't store a std::istringstream instance, avoid creation of std::string when ctor is called
2012-05-16 09:04:03 -07:00
Edoardo Prezioso 573256350a Fixed: mathlib.cpp(258): warning C4702: unreachable code. 2012-05-16 15:26:03 +02:00
PKEuS 279b0c59bb Don't set Preprocessor::missingIncludeFlag if missingInclude warning is suppressed (#3487). 2012-05-16 02:59:45 -07:00
PKEuS 0157f937bf Fixed #3760: Added explicit to C++ keyword list in setVarId
Made some constant arrays static
2012-05-16 01:59:52 -07:00
PKEuS e8cd119ebd Improved parsing of functions that accept nullpointers but no uninitialized data (Fixed #3811) 2012-05-16 00:56:39 -07:00
PKEuS 132a95b5f2 Fixed bug in symboldatabase: Don't ignore const or static on variables declared that are declared with both keywords. (Fixes #3805) 2012-05-15 12:03:43 -07:00
Daniel Marjamäki 4ae8e4f382 Tokenizer::setVarId: Minor fix of sizeof handling 2012-05-15 18:40:24 +02:00
PKEuS 4871cef351 Refactorized test cases for uninitMemberVar check:
- Moved all test cases to a single file (testconstructors.cpp)
- Removed some redundant test cases that became unnecessary after the symbolDatabase was established as independant from this check
2012-05-15 02:36:27 -07:00
Daniel Marjamäki a0e5fad6a9 Fixed #3776 (Tokenizer::setVarId: No varid set when unknown macro is used before variable declaration) 2012-05-15 07:17:31 +02:00
PKEuS 42fd19fb37 Refactorization in checkclass.cpp:
- Improved handling of pointers and constants in constructor checking (-> Fixed #3801)
2012-05-14 12:50:23 -07:00
PKEuS 1dee3b04b9 Bugfixes in SymbolDatabase:
- Constant pointers are now detected as variable declarations
- Probably fixed #3802
2012-05-14 12:47:02 -07:00
Edoardo Prezioso eacf74be8d Changed the order of some structures in order to improve, even if for a bit, their padding. 2012-05-14 20:49:03 +02:00
Daniel Marjamäki fc7f78244e Fixed #3708 (False positive: uninitialized variable (allocation, unknown nonpointer type)) 2012-05-14 18:34:39 +02:00
Ettl Martin 8a7b141246 added testcase for ticket 3689 2012-05-14 09:57:30 +02:00
Daniel Marjamäki 895ee61ed5 Visual Studio: Updated VS2008 project files 2012-05-13 18:07:22 +02:00
Daniel Marjamäki 62f9875f90 Fixed #3799 (Bug: Function gets varId) 2012-05-13 07:55:35 +02:00
PKEuS 06a77679d4 Refactorizations:
- Added support for pointers in self assignement check
- Removed redundant for loop in checknullpointer.cpp
- Fixed warning about signed/unsigned mismatch in cppcheck.cpp by making Settings::_maxConfig unsigned
2012-05-11 10:38:19 -07:00
PKEuS 0452b03f53 Refactorizations in SymbolDatabase:
- Moved complete evaluation of variables type into one function executed when the variable is constructed
- Moved SymbolDatabase::ArrayDimensions to Variable::ArrayDimensions
2012-05-11 17:56:47 +02:00
PKEuS 11a296cb02 Fixed #2708: Print message before checking and after checking is interrupted if there are too many preprocessor configurations
Removed redundant suppression check because the same check is done inside reportErr again.
2012-05-09 09:54:43 -07:00
Daniel Marjamäki 8236cd4d50 Fixed #3785 (false positive: (style) Variable 'dinv' is assigned a value that is never used) 2012-05-08 12:04:54 -07:00
Daniel Marjamäki dad2fb6db1 Fixed #3737 (Preprocessor: __cplusplus always defined for c++ code) 2012-05-08 11:49:43 -07:00
Daniel Marjamäki 99a29eafc9 Fixed #3691 (Tokenizer::simplifyKnownVariables: continue in switch) 2012-05-07 12:11:23 -07:00
Daniel Marjamäki 2fbd77c5a1 Fixed #3715 (false positive checking a map bounds) 2012-05-07 12:03:33 -07:00
PKEuS db914d7185 Fixed compiler errrors and warnings mentioned in #3783 2012-05-07 06:34:47 -07:00
PKEuS ec00824fd3 Fixed #3357:
- Print "inconclusive" tag in cli
- Fixed inconclusive handling in checkbufferoverrun.cpp
- Merged reportInconclusiveError into reportError by adding an additional parameter "bool inconclusive" which is false per default
2012-05-06 10:37:41 -07:00
PKEuS 6ef92c4fd7 Use recently implemented new constructor of ErrorLogger::ErrorMessage in checkmemoryleak.cpp and symboldatabase.cpp
Fixed test failure introduced in f105bf75a6
2012-05-06 04:01:56 -07:00
PKEuS 28f6e2f4a9 Resolved cyclic dependency between Tokenizer and TemplateSimplifier 2012-05-06 01:38:55 -07:00
PKEuS f105bf75a6 Refactorizations in ErrorLogger:
- Implemented constructor for ErrorLogger::ErrorMessage that takes a callstack of tokens -> replaced duplicate code in Check and Tokenizer
- Implemented strigify() for ErrorLogger::ErrorMessage::FileLocation to replace two identical implementations of it.
2012-05-06 01:17:15 -07:00
Daniel Marjamäki 37cdb515af Generated new VS2008/VS2010 project files (testrunner) 2012-05-05 11:18:50 -07:00
Daniel Marjamäki c3573f7db1 Generated new VS2008/VS2010 project files 2012-05-05 11:10:41 -07:00
Daniel Marjamäki 58bee0afde Makefile: generated new Makefiles since the Tokenizer has been split up 2012-05-05 18:39:29 +02:00
PKEuS 1a5fbd61d2 Splitted class TokenList from Tokenizer 2012-05-05 09:33:26 -07:00
Ettl Martin 5d088aa99c fixed wrong spelled words in comments. No function change. 2012-05-05 15:21:27 +02:00
Daniel Marjamäki 11614021e8 Fixed #3768 (Tokenizer::setVarId: no varid for 'std::string' parameter after a 'std::string' parameter called 'string') 2012-05-05 09:59:43 +02:00
Daniel Marjamäki 005ce81689 Fixed #3640 (False positive: statement begins with numeric code) 2012-05-04 17:53:47 +02:00
Daniel Marjamäki 119b24e363 Fixed #3756 (False positive: uninitvar in malloc) 2012-05-03 19:10:51 +02:00
PKEuS aec57db9b2 Fixed #3778: Added missing function Function::getArgumentVar 2012-05-03 13:29:41 +02:00
PKEuS 04704ac5fa Refactorizations in checkmemoryleak.cpp:
- Use symbolDatabase more often to increase performance and accuracy.
- Replaced indendation counter
- Replaced custom stringify implementation

Benchmark results (sqlite checking):
4% complete, 7% on "Memory leaks (function variables)", 9% on "Memory leaks (address not taken)" and 82% on "Memory leaks (struct members)"
2012-05-03 10:43:47 +02:00