Commit Graph

3839 Commits

Author SHA1 Message Date
PKEuS 5e862351e9 Improvements in token.cpp:
- Shortened stringify output - 4 or more subsequent empty lines are abbreviated
- Fixed detection of comparision operators
- Make use of _type: Replaced three asserts by one
2012-08-02 11:36:54 -07:00
PKEuS 1b40668e04 Refactorizations:
- Made several functions (Check*::myName and others) because they don't touch depend on a specific instance. (cppcheck findings)
- Removed description of a check in CheckConst that has moved to CheckIO
2012-08-02 09:50:48 -07:00
PKEuS 452f95cea0 More robust template detection in clarifyCondition check based on Token::link. (#3818)
Create links between < and > only on non-C code.
AStyle fix
2012-08-02 04:03:01 -07:00
PKEuS 3b5dabdb14 Clarified errormessage of checkBoost 2012-08-02 02:40:08 -07:00
PKEuS c8e40773f1 Fixed cppcheck messagesa about functions that can be const/static:
- Made Tokenizer::getErrorMessages static - Avoids creation of unnecessary instance of Tokenizer
- Changed Tokenizer::removeExceptionSpecifications to common style for simplification functions. In contrast to the comment, this function doesn't call itself recursivly - fixed comment.
- Made Tokenizer::IsScopeNoReturn static.
2012-08-01 12:04:47 -07:00
PKEuS 88e4794d6e Refactorized CheckClass::checkConst:
- Added checking for functions that can be even declared static (#1971. Removed fix for #1563)
- Consistent usage of Function::TokenDef to avoid problems with scope identifiers
- Rewrote parsing of function body making it more generic
- Removed three redundant tests
2012-08-01 10:24:38 -07:00
Ettl Martin 98d608231d spelling fixes 2012-07-31 23:35:56 +02:00
Ville Skyttä dce16a970d spelling fixes 2012-07-31 21:28:42 +02:00
PKEuS cc1faad34a Removed bailouts in CheckClass::privateFunctions and CheckUnusedFunctions when checking code with templates (unnecessary after 2c10e9a6ca) 2012-07-29 08:05:54 -07:00
Daniel Marjamäki 2c10e9a6ca TemplateSimplifier: Removed unused function 2012-07-29 16:14:26 +02:00
Daniel Marjamäki 435340b463 Fixed #3814 (false positive: missing constructor) 2012-07-29 16:01:05 +02:00
PKEuS 4e2a86260f Really fixed #3941. 2012-07-29 06:50:05 -07:00
PKEuS 26a2379f9f Fixed false positive #3941. 2012-07-29 06:39:43 -07:00
PKEuS 1ec3c9f634 Fixed hang in libreoffice code (simplification of K&R style function declaration tried to simplify a function with parameters without name whose implementation contained "; {".
Test cases of this simplification only need basic simplifications done in Tokenizer::tokenize
2012-07-29 06:11:48 -07:00
PKEuS 6aa7f984cb Fixed false positives on FILE* arrays. (#3965) 2012-07-29 04:04:12 -07:00
PKEuS 2f95b97c66 Message refactorization: checkobsoletefunctions.h and checknonreentrantfunctions.h 2012-07-29 02:30:03 -07:00
Daniel Marjamäki 79c84029fb Preprocessor: Reduce simplifyVarMap usage to make Cppcheck a bit faster 2012-07-27 12:30:43 +02:00
Daniel Marjamäki 0ead18122d Fixed #3695 (False positive: memory leak (ptr?free(ptr):0)) 2012-07-27 12:25:20 +02:00
PKEuS 643f3890b4 Fixed #4003: tmpnam may be called with a nullpointer 2012-07-27 01:36:22 -07:00
Daniel Marjamäki 1a6f7ea9a0 Fixed #3998 (Tokenizer::simplifyEnum: wrong handling of expressions => crash) 2012-07-26 11:12:28 +02:00
PKEuS c11e8cdbfa Fixed false positive "Variable is not assigned a value" on class types 2012-07-25 00:34:27 -07:00
Daniel Marjamäki f82e5396c8 Fixed #3999 (Error incorrectly written in XML format) 2012-07-25 06:43:54 +02:00
PKEuS f5e5d59562 Refactorizations:
- Removed redundant newlines at the end of test cases
- Make use of STL algorithms instead of own implementations of std::replace and std::remove+string::erase
- Removed unused variable (found by cppcheck)
- Prefer postfix increment (found by cppcheck)
2012-07-24 12:21:05 -07:00
PKEuS bb940e4722 Implemented unused variable checking for standard types (#2851) 2012-07-24 11:47:29 -07:00
Daniel Marjamäki e6f761126c Fixed #2802 (False positive: ::free() is not recognised as free() to release buffers) 2012-07-24 09:28:08 +02:00
PKEuS 5c0cab238f Fixed useInitializationList false positives (#3988) 2012-07-23 08:16:47 -07:00
PKEuS ae6201d289 Fixed false positive "Parameter 'x' is passed as a value" for types like std::vector<T>::size_type (#3986) 2012-07-23 01:41:20 -07:00
Daniel Marjamäki a733c9b603 Fixed #3914 (false positive null pointer dereference, assignment in conditional) 2012-07-23 10:05:55 +02:00
Zhao Qifa 188d2e143d add a performance checker for const assignment 2012-07-22 09:17:00 +02:00
Ville Skyttä 7ab2f6a9fa Spelling fixes. 2012-07-21 18:11:20 +02:00
Daniel Marjamäki 9352e124fe Auto variables: Speedup my fix. Use the symbol database instead of Token::findmatch. 2012-07-19 16:42:56 +02:00
Daniel Marjamäki dc6c3228d7 Fixed #3834 (Preprocessor: -U doesn't work) 2012-07-18 20:57:00 +02:00
Daniel Marjamäki 17c27f51ff Fixed #3791 (False positive: returnTempReference) 2012-07-18 07:22:29 +02:00
Daniel Marjamäki a768b0e8b2 Fixed #3954 (Pointer reference memory leak false positive) 2012-07-17 16:28:34 +02:00
Daniel Marjamäki d34924ba6d Uninitialized variables: Fixed false positive when there is assignment in condition 2012-07-17 07:03:40 +02:00
Daniel Marjamäki ddfc968028 Fixed #3891 (False positive 'Double deallocation:' due to ((void*)1)) 2012-07-16 17:07:51 +02:00
Daniel Marjamäki a96ec0ad46 Fixed #3804 (False positive: Member not initialized (simplifyTokenList removes const on pointers)) 2012-07-16 07:28:59 +02:00
PKEuS e9182f1fcc Implemented support for 'using namespace std;': Add std:: prefix to names that are known to be in std namespace. Simplify namespace (std::)tr1:: if C++11 flag is set. 2012-07-15 02:05:19 -07:00
PKEuS 1e704edbd5 Message refactorization: checkio.h/cpp 2012-07-13 10:36:58 -07:00
PKEuS 41fecb2e6d Fixed evaluation of redundant conditions (#3972) 2012-07-13 06:01:19 -07:00
PKEuS 247d820027 Fixed #3972: Don't issue auto variable error when the address is assigned to a reference to a non-pointer. 2012-07-13 05:21:45 -07:00
PKEuS 4ed15d87b6 Properly fixed test failure and line numbers in uselessCallsEmpty error 2012-07-13 05:15:58 -07:00
Daniel Marjamäki 5645269bbf Preprocessor: Made proper fix for #3690 2012-07-13 11:36:02 +02:00
Daniel Marjamäki e4ad193b40 Fixed #3690 (CppCheck is stuck on evaluating false preprocessor expression( = 0)) 2012-07-13 11:28:45 +02:00
Daniel Marjamäki 6018bb4636 Fixed #3442 (unmatchedSuppression can't be suppressed) 2012-07-13 08:29:49 +02:00
PKEuS 5a91d6a0f5 Check for useless calls of .empty() (#3816)
Messages from CheckStl::uselessCalls() only shown when correct severity is enabled.
2012-07-12 03:23:52 -07:00
PKEuS 3523f89917 Added 'char' back where I removed it by mistake. 2012-07-12 01:01:52 -07:00
Daniel Marjamäki 8dd5270be3 Preprocessor: skip preprocessor directives in the Preprocessor::validateCfg function 2012-07-11 21:20:31 +02:00
PKEuS 2bd1f1d8dc Improved check: Sign checking in printf format string (#3511)
Removed some redundant code (already covered by token list simplifications and symboldatabase)
2012-07-11 10:46:35 -07:00
Daniel Marjamäki 4f4be79f20 Preprocessor: Fixed bugs in my #3643 fix 2012-07-11 18:29:33 +02:00