Commit Graph

326 Commits

Author SHA1 Message Date
Daniel Marjamäki 5914af4481 refactoring CheckClass 2009-03-20 17:30:24 +01:00
Daniel Marjamäki 3fab99a5cb astyle formatting 2009-03-19 19:35:47 +01:00
Daniel Marjamäki 75171cae08 refactoring: fixed the teststl so it is runnable again 2009-03-19 19:35:08 +01:00
Daniel Marjamäki 09ff4fa35f Merge branch 'master' of git@github.com:danmar/cppcheck 2009-03-18 22:41:01 +01:00
Daniel Marjamäki a573c62cd5 refactoring: first step - started with checkstl 2009-03-18 22:40:38 +01:00
Nicolas Le Cam 2b199ffb9b Fix compilation on 64bit systems 2009-03-18 22:13:27 +01:00
Daniel Marjamäki f37dd4f143 Fixed ticket 184 (Tokenizer - Simplification: Split up variable declarations) 2009-03-18 20:32:05 +01:00
Reijo Tomperi 2fb4c52728 Fixed tokenizer: "return - 2 ;" --> "return -2 ;" 2009-03-18 20:48:06 +02:00
Reijo Tomperi ca055dc830 Fix ticket #191 (semicolon after #endif stop tokenizing of function)
http://apps.sourceforge.net/trac/cppcheck/ticket/191
2009-03-18 01:10:26 +02:00
Reijo Tomperi 896abcb569 Fixed some memory leaks in test cases 2009-03-17 21:59:40 +02:00
Daniel Marjamäki 9c057c707b tokenize negative numbers into a single token 2009-03-17 20:50:06 +01:00
Daniel Marjamäki 128215d692 Added test case for detecting false positive in the STL size handling 2009-03-17 18:54:50 +01:00
Reijo Tomperi c413c8d4b3 Fix ticket #179 (preprocessor issues)
http://apps.sourceforge.net/trac/cppcheck/ticket/179
2009-03-16 23:20:55 +02:00
Daniel Marjamäki f9b481ae3a Ticket #184 (Tokenizer - Simplification: Split up variable declarations), added testcases 2009-03-16 19:03:23 +01:00
Daniel Marjamäki 0cc7672673 Fixed Ticket #82 (detect buffer overrun; dynamic memory) 2009-03-16 18:11:09 +01:00
Reijo Tomperi 1c74978a92 test case stringify3 added 2009-03-15 23:39:58 +02:00
Reijo Tomperi 21b687b301 Improved tokenizer to handle '#' better. Previously everything after # was combined into a single token,
now # is considered more like an alphabet, with few exceptions, e.g. "##" tokens.
2009-03-15 23:09:27 +02:00
Daniel Marjamäki a6ad972aad Fix Ticket 180 (Templates: Expanding member functions that are not implemented inline) 2009-03-15 20:03:29 +01:00
Daniel Marjamäki 9b06b22053 templates: replace constructor/destructor names when expanding template classes 2009-03-15 17:07:05 +01:00
Reijo Tomperi b26955b9f8 Test case stringify2() added. 2009-03-15 16:05:23 +02:00
Reijo Tomperi ca7870af33 Fix ticket #177 (Tokenizer doesn't add braces around if-scope)
http://apps.sourceforge.net/trac/cppcheck/ticket/177
2009-03-15 14:44:57 +02:00
Reijo Tomperi bb3316a45b Fix ticket #181 (#pragma causes wrong line numbers)
http://apps.sourceforge.net/trac/cppcheck/ticket/181
2009-03-15 14:23:12 +02:00
Daniel Marjamäki 6eadbaae04 templates: better handling of templates with multiple type arguments 2009-03-14 21:26:32 +01:00
Daniel Marjamäki 75d0e8687b Memory leak: handle allocation in deallocation list 2009-03-14 20:19:36 +01:00
Daniel Marjamäki 02df14ec37 Memory leaks: Refactoring to use Tokenizer::FindClassFunction. Enabled test case, the memory leak is now detected 2009-03-14 18:21:37 +01:00
Daniel Marjamäki 3b29125d65 added testcase for 'Tokenizer::FindClassFunction' 2009-03-13 22:38:42 +01:00
Daniel Marjamäki 0a6a0ae46e TestMemleak: added two testcases for checking for leaks in classes 2009-03-13 19:52:01 +01:00
Reijo Tomperi 3c4704a00c Fix ticket #151 (Handling of namespaces)
http://apps.sourceforge.net/trac/cppcheck/ticket/151
2009-03-13 01:07:05 +02:00
Daniel Marjamäki 4c28882a12 expanding template classes 2009-03-12 22:17:42 +01:00
Daniel Marjamäki f96e2deb1a uninitialized const pointer member variables 2009-03-12 21:33:10 +01:00
Daniel Marjamäki 1514e65464 astyle style fixes 2009-03-11 19:14:45 +01:00
Daniel Marjamäki 77cf2213fe templates: simplify template functions with 1 type argument 2009-03-11 18:50:24 +01:00
Reijo Tomperi 657495b825 astyle fix 2009-03-11 00:49:16 +02:00
Daniel Marjamäki eac29d151c made the Tokenizer::simplifyCasts more generic 2009-03-10 21:26:08 +01:00
Daniel Marjamäki cd54a0ed3b Fixed ticket 147 (Invalid line number for error message) 2009-03-09 20:29:25 +01:00
Daniel Marjamäki f8cd34198b simplify casts 2009-03-09 19:47:21 +01:00
Reijo Tomperi 1c626c53c2 Added test case for #147 (Invalid line number for error message)
http://apps.sourceforge.net/trac/cppcheck/ticket/147
macro_linenumbers() in test/testpreprocessor.cpp
2009-03-08 22:28:12 +02:00
Reijo Tomperi 765da17132 Astyle fix 2009-03-08 09:49:04 +02:00
Reijo Tomperi 5be85d71a0 Fix ticket #145 (Line numbers are invalid if file is included inside #ifdef)
http://apps.sourceforge.net/trac/cppcheck/ticket/145
2009-03-08 09:45:53 +02:00
Daniel Marjamäki cc8a6168e7 astyle formatting 2009-03-06 18:13:41 +01:00
Daniel Marjamäki d7cd09cb6e added internal support for handling list of classes that are automaticly deallocated 2009-03-06 07:22:07 +01:00
Reijo Tomperi 6fcb89f136 Fix segmentation fault that happens with invalid code. 2009-03-05 23:22:00 +02:00
Reijo Tomperi 42a9eb9e53 Fix ticket #133 (Segmentation fault when static_cast is in for loop) 2009-03-05 21:32:02 +02:00
Daniel Marjamäki 547f120ee9 known variables: better handling of ++ and -- 2009-03-04 06:03:51 +00:00
Reijo Tomperi 832275bc37 Fix #132 (False positive returning memcpy()) 2009-03-03 20:39:17 +00:00
Reijo Tomperi 69c23301db Fix ticket Add/Change #125 (the printout of the token list is wrong) 2009-03-03 20:17:23 +00:00
Daniel Marjamäki 37c889ab30 unused private function: better handling of initialization lists in constructors 2009-03-02 20:40:24 +00:00
Daniel Marjamäki 86050cccdb unused private function: fixed false positive (ticket: 129) 2009-03-02 17:16:02 +00:00
Daniel Marjamäki 87b0314e72 memory leak: fixed issue with reporting wrong location 2009-03-01 20:34:04 +00:00
Reijo Tomperi fc8f47145a Copyrights updated 2009-03-01 19:52:33 +00:00
Daniel Marjamäki c7b068c174 variable id: fixed so that the variable ids are assigned correctly (ticket:126) 2009-03-01 16:37:02 +00:00
Daniel Marjamäki 4e465f7073 variable declarations: don't simplify when declaring and assigning array in the same statement 2009-02-28 20:40:37 +00:00
Daniel Marjamäki c3bbd603c0 variable id: handling 'return' and 'else' better 2009-02-28 20:21:48 +00:00
Daniel Marjamäki 045477e6ac moved sizeof tests to the TestSimplifyTokens class 2009-02-28 09:09:55 +00:00
Daniel Marjamäki c7197aed8c refactoring unit tests 2009-02-28 08:59:48 +00:00
Daniel Marjamäki 7d9bf491ec sizeof: fixed a problem with 'sizeof(varname)' but there are more to fix with it 2009-02-28 08:34:02 +00:00
Daniel Marjamäki 6b7b27a2e8 simplify known variable: don't simplify this ';i++;' 2009-02-27 18:25:47 +00:00
Daniel Marjamäki dddfc50dff Reverted changes made in [1289] 2009-02-27 07:50:39 +00:00
Daniel Marjamäki f4a8bc85f2 simplify tokens: fixed bug when removing redundant parantheses around variable 2009-02-27 06:07:38 +00:00
Daniel Marjamäki 91011b8450 array index out of bounds: Added todo test case TestBufferOverrun::array_index_13 for ticket #118 2009-02-26 19:46:59 +00:00
Daniel Marjamäki c1da4ae57d simplify tokens: remove redundant parantheses around variable.. 'p = (q);' 2009-02-25 19:55:24 +00:00
Daniel Marjamäki 35583293ec memory leak: Fixed a false positive when all is given 2009-02-25 19:20:23 +00:00
Daniel Marjamäki dac1e91013 unused private function: Handle 'embedded' function implementations better 2009-02-25 18:03:17 +00:00
Daniel Marjamäki 66c13c7173 reverted [1282] because some changes were committed by mistake 2009-02-24 17:49:43 +00:00
Daniel Marjamäki 8c3e3faa07 checkclass: refactoring 2009-02-24 17:48:11 +00:00
Daniel Marjamäki 1e3047b9c2 simplify tokens: simplify known variable value handles ++ and -- better 2009-02-24 16:11:37 +00:00
Daniel Marjamäki d15aea1b0c memory leak: fixed false positive when using 'return strcpy' 2009-02-24 06:23:21 +00:00
Daniel Marjamäki 44a5cecd99 memory leaks: improved handling of --vcl 2009-02-23 19:32:54 +00:00
Daniel Marjamäki d8927e720d constructors: don't warn about missing constructor if class only has static variable members 2009-02-21 13:35:55 +00:00
Daniel Marjamäki 08f76279ed buffer overrun: catch cases when using cin to read to a char array 2009-02-21 12:22:04 +00:00
Daniel Marjamäki 5269e38ae2 security: renamed classes 2009-02-21 12:12:31 +00:00
Daniel Marjamäki b826d2e41b security: Renamed files 2009-02-21 12:07:19 +00:00
Daniel Marjamäki a9009ebf7d TestClass: Added test for uninitialized "mutable int i" 2009-02-21 08:24:57 +00:00
Daniel Marjamäki ed86d924df buffer overrun: dangerous usage of strncpy+strncat 2009-02-20 21:16:07 +00:00
Daniel Marjamäki 15e86db3ed buffer overrun: Added checking of strncat 2009-02-20 21:00:59 +00:00
Daniel Marjamäki 0e1ef1f45f added todo testcases for strncat checking 2009-02-20 20:00:49 +00:00
Daniel Marjamäki 439b8c4051 simplify known variables: variable used as array index 2009-02-20 17:27:57 +00:00
Daniel Marjamäki 385be6d0d9 memory leak: Added command line flag '--vcl' that is used to suppress error messages for VCL code 2009-02-20 06:28:18 +00:00
Reijo Tomperi 4fc774deda Multicore cpu support for Linux (currently disabled and compiling produces warnings)
"no errors" output removed.
2009-02-19 22:21:18 +00:00
Daniel Marjamäki efeaac736d security: added simple gui checking 2009-02-19 17:57:27 +00:00
Daniel Marjamäki 4e1f19a366 input validation: added checking 2009-02-19 08:03:14 +00:00
Daniel Marjamäki a844fa017e fixed failed tests 2009-02-18 20:04:34 +00:00
Daniel Marjamäki 19c8473294 reverted [1254] it was made by mistake 2009-02-18 20:01:44 +00:00
Daniel Marjamäki dc2ecb8980 stl push_back: Added check (invalid iterator) 2009-02-18 19:58:50 +00:00
Daniel Marjamäki 2b04c94b95 stl push_back: Added check (invalid iterator) 2009-02-18 19:57:43 +00:00
Daniel Marjamäki 1043b76d31 Added Tokenizer::elseif for breaking up 'else if' into 'else { if ..' 2009-02-17 19:18:26 +00:00
Daniel Marjamäki 5b24319cf1 varid: Added a todo test case for giving function parameters varid 2009-02-16 20:46:24 +00:00
Daniel Marjamäki 4aef89c311 tokenizer: fixed issues related to variable ids
* use setVarId in simplifyTokenList
 * make sure function parameters and variables declared in for example for loops get variable ids
2009-02-16 17:41:33 +00:00
Daniel Marjamäki b1982b2041 tokenizer: improved the simplification of '*(var+num)' => 'var[num]' 2009-02-15 14:02:57 +00:00
Daniel Marjamäki 56d685c179 tokenizer: Remove redundant parantheses around number. Ticket: #105 2009-02-15 13:28:54 +00:00
Daniel Marjamäki 265ef0f4a5 Tokenizer: Fixed bug in tokenizer that removed '\' from preprocessor lines
Ticket: #106
2009-02-15 11:42:04 +00:00
Reijo Tomperi 669913568c Added test case TestTokenizer::sizeof5 2009-02-14 21:49:36 +00:00
Reijo Tomperi 1e07847ecf Constant variable converting converted struct members (foo.a => foo.45) also, fixed that. 2009-02-14 21:33:28 +00:00
Reijo Tomperi fba8c54758 Fix ticket #107 (Convert + + into + and + - into -) and add test case for it 2009-02-14 20:56:08 +00:00
Reijo Tomperi 413bf32cf2 Fixed typos in test case and enabled it. 2009-02-14 18:44:50 +00:00
Daniel Marjamäki 4a1488b1a9 tokenizer: tokenize '++', '--' and '>>' correctly 2009-02-14 10:13:50 +00:00
Reijo Tomperi d1e9efc66a Fix ticket #104 (Change (error) Uninitialized member variable -> (style) Member variable not initialized in the constructor) 2009-02-14 08:52:03 +00:00
Daniel Marjamäki 5c1995ca81 memory leak: handle 'delete (p)' and 'delete [] (p)'. Fixes ticket 102 2009-02-14 06:54:23 +00:00
Daniel Marjamäki 881460f71b simplify tokens: added todo test case, the varid is lost when simplifying variable declarations 2009-02-13 17:25:23 +00:00
Daniel Marjamäki 3b194ff851 simplify token list: Added a TODO test case. variable id is lost 2009-02-13 16:23:02 +00:00