Commit Graph

644 Commits

Author SHA1 Message Date
Daniel Marjamäki 435340b463 Fixed #3814 (false positive: missing constructor) 2012-07-29 16:01:05 +02: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 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
Daniel Marjamäki bf98e952c1 Fixed #3927 (false positive: (error) Uninitialized variable: new) 2012-07-08 13:59:00 +02:00
Thomas Sondergaard f72ddbb2e9 Fixed #3912 (Analysis failed) 2012-07-03 06:34:14 +02:00
Daniel Marjamäki bb9f114d84 Fixed #3924 (False positive: Uninitialized variable (const pointer)) 2012-06-30 12:12:36 +02:00
Daniel Marjamäki 8af044255d Tokenizer: Added new function isFunctionParameterPassedByValue that check if a parameter is passed by value 2012-06-24 13:40:09 +02:00
Daniel Marjamäki 974225626d Fixed #3901 (false positive: (error) Uninitialized variable: temp) 2012-06-19 20:07:39 +02:00
Daniel Marjamäki 5174f7ff5e Fixed #3723 (Preprocessor evaluation order) 2012-06-14 21:47:03 +02:00
Daniel Marjamäki 4b6e1c6946 Fixed #3855 (false positive: (error) Instance of 'locale' object destroyed immediately) 2012-06-13 19:21:20 +02:00
August Sodora 90f92250dd Fixed #3618 (segmentation fault of cppcheck) 2012-06-12 21:07:17 +02:00
Daniel Marjamäki 54a66391d8 Fixed #3750 (false positive: C-style pointer casting) 2012-06-12 18:45:31 +02:00
August Sodora e146591b5d Fixed #3544 (segmentation fault of cppcheck) 2012-06-02 16:15:12 +02:00
Daniel Marjamäki 5b0551054a varid: better templates handling 2012-05-22 18:58:13 +02: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
Daniel Marjamäki 4ae8e4f382 Tokenizer::setVarId: Minor fix of sizeof handling 2012-05-15 18:40:24 +02: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
Daniel Marjamäki 62f9875f90 Fixed #3799 (Bug: Function gets varId) 2012-05-13 07:55:35 +02: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 99a29eafc9 Fixed #3691 (Tokenizer::simplifyKnownVariables: continue in switch) 2012-05-07 12:11:23 -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 1a5fbd61d2 Splitted class TokenList from Tokenizer 2012-05-05 09:33:26 -07: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 119b24e363 Fixed #3756 (False positive: uninitvar in malloc) 2012-05-03 19:10:51 +02:00
Edoardo Prezioso 5d6a257c86 Fixed #3770 (Segmentation fault in K&R function parameters simplification) 2012-04-29 12:58:52 +02:00
Daniel Marjamäki df6f88b4fe Fixed #3755 (Tokenizer::setVarId: improve varid inside class for struct/class variables) 2012-04-26 18:38:47 +02:00
PKEuS 30e8e389a7 Fixed #2980 2012-04-26 10:58:35 +02:00
PKEuS 1e708e10d0 Fixed #2875 2012-04-26 10:35:40 +02:00
PKEuS a4c4c66a4c Added test case for #3466 2012-04-25 21:14:25 +02:00
Daniel Marjamäki f84a4344ae Fixed #3754 (Tokenizer::simplifyKnownVariables: wrong for loop simplification) 2012-04-25 19:23:17 +02:00
Daniel Marjamäki 6ae135124e Tokenizer::setVarId: better handling of initializer lists 2012-04-23 18:26:27 +02:00
Ettl Martin d0b7a3514b added unittest to fix sample code #3721 2012-04-22 17:28:27 +02:00
Daniel Marjamäki 706631f527 Fixed #3748 (False positive out of bounds with postincrement) 2012-04-22 12:22:49 +02:00
Daniel Marjamäki d5f6cfcfa8 Tokenizer: Use new setVarId function. Removed the old one. 2012-04-22 11:36:31 +02:00
Daniel Marjamäki 807f49ce83 testrunner: fixed test case when TestTokenizer::setVarIdOld is used 2012-04-22 09:56:02 +02:00
Daniel Marjamäki 71050bc586 Tokenizer::setVarIdNew: fixed TestTokenizer::varid_in_class2 test case 2012-04-22 08:51:19 +02:00
Edoardo Prezioso 8dfde7def8 Added missing testcase from previous commit. 2012-04-22 02:41:51 +02:00
Edoardo Prezioso be5a61b794 Fixed ticket #3721 (false positive: syntax error on valid C code ( K&R function style )). 2012-04-22 01:56:40 +02:00
Daniel Marjamäki f3cbb3f05d TestTokenizer: Removed varid test cases that have impossible source code 2012-04-21 19:07:35 +02:00
Daniel Marjamäki bd60dd46d0 Tokenizer::setVarIdNew: handle special case when there is an unknown macro. Ticket #2638 2012-04-21 17:57:20 +02:00
PKEuS 88aa08e71b Refactorizations in test suite:
- Removed redundant tokenization helper functions in testtokenize.cpp and testsimplifytokens.cpp
- Pass arguments as const char[] or const std::string& to avoid instanciation or at least copying of strings
- Removed redundant calls to Tokenizer::validate() - This function is already called implicitly by tokenize() and simplifyTokenList()
2012-04-17 09:51:08 +02:00
PKEuS bac8ed7127 Refactorized stringification of tokens:
- Function that stringifies one token: Token::stringify()
- Functions that stringify a list of tokens: Token::stringifyList()
-- Single and powerful "base" function, used by several "light" functions
Refactorized
- testtokenize.cpp and testsimplifytokens.cpp: Use improved stringification functions instead of several local implementations
- Avoided redundand creation of std::string when using TestTokenizer::tokenizeAndStringify and in cmdlineparser.cpp
2012-04-16 19:51:07 +02:00
PKEuS 1c3c94dc67 New simplification: Remove 'extern "C"' from C++ code.
Refactorization in cppcheck.cpp: Catch exception as const reference instead of non-const reference.
2012-04-16 16:25:04 +02:00
Daniel Marjamäki c58d02f146 Tokenizer::setVarIdNew: in C code, allow that variable declaration starts with delete and throw 2012-04-15 18:23:12 +02:00
Daniel Marjamäki 46bfe27831 Tokenizer::setVarIdNew: Better handling of function calls 2012-04-15 17:44:51 +02:00
Daniel Marjamäki 31f8a71f84 Tokenizer::setVarIdNew: Better handling for catch-exception-by-reference 2012-04-15 17:39:22 +02:00
Daniel Marjamäki 3c1dfc658c Tokenizer::setVarIdNew: use the new setVarId with a few more test cases. Improved setVarId: references in executable scopes must be initialized. 2012-04-15 14:32:47 +02:00
Daniel Marjamäki 27c37896a0 Tokenizer::setVarIdNew : use new setVarId function in TestTokenizer::varidReturn2. 2012-04-15 14:19:17 +02:00
Daniel Marjamäki 95dafd30dd Tokenizer::setVarIdNew : enable more testcases. better handling of unions and struct members. 2012-04-15 13:42:13 +02:00
Daniel Marjamäki 4c79a1af20 testrunner: use new Tokenizer::setVarId function in some unit tests 2012-04-15 12:49:53 +02:00