Nicolas Le Cam
ad7df1cbe0
Add TestMemleak::realloc4 that currently fail.
...
Change TestMemleak::if10, TestMemleak::forwhile8 and TestMemleak::realloc2 as they are currently leaking memory, mark them as TODO.
Comment out TestMemleak::forwhile9 and TestMemleak::forwhile10 as they are wrong (infinite loops).
2009-03-28 16:21:55 +01:00
Daniel Marjamäki
022dbc651e
removed TestOther::zeroDiv3 - it is not valid
2009-03-28 08:02:15 +01:00
Daniel Marjamäki
4059a2ad05
added check for zero division. The code was written by Nguyen Duong Tuan
2009-03-28 07:49:47 +01:00
Daniel Marjamäki
c0b608059a
possible null pointer dereference after a while-loop
2009-03-27 17:19:34 +01:00
Daniel Marjamäki
7afccc395a
testing: new handling of todo test cases. If they use TODO_ASSERT_EQUALS instead we can detect when they are fixed
2009-03-25 18:31:40 +01:00
Daniel Marjamäki
0cfa241abb
variable id: enabled test case for function parameters
2009-03-25 18:15:49 +01:00
Daniel Marjamäki
c74da7bab9
variable id: give std::string variables an id
2009-03-25 18:10:03 +01:00
Daniel Marjamäki
b9f4a773b8
Buffer overrun: Added check to detect when size argument to memset is a char constant ( #213 )
2009-03-25 07:25:10 +01:00
Daniel Marjamäki
9f3634412e
simplify tokens (known variable values in conditions)
2009-03-25 07:10:17 +01:00
Daniel Marjamäki
afcaa30b51
Fixed ticket 216 (False positive: variable scope)
2009-03-24 20:59:56 +01:00
Daniel Marjamäki
c0039a2551
added testcase
2009-03-24 20:24:03 +01:00
Daniel Marjamäki
6580e0eb21
fixed snprintf false positive ( #210 )
2009-03-24 18:43:39 +01:00
Daniel Marjamäki
65070cc067
Simplify if conditions more.. simplifyIfAssign + simplifyIfNot
2009-03-24 18:23:21 +01:00
Daniel Marjamäki
44c952873e
Fixed ticket 205 (False positive: char variable used in bit operation)
2009-03-23 19:04:51 +01:00
Daniel Marjamäki
06776c6ac7
Fixed the testcase TestMemleak::realloc3
2009-03-23 18:34:59 +01:00
Daniel Marjamäki
7905cbc5e7
simplify tokens: move assignment out from condition (Ticket #201 )
2009-03-23 18:20:56 +01:00
Daniel Marjamäki
c9d02273b8
added todo test case for ticket 200
2009-03-22 21:42:01 +01:00
Vesa Pikki
f04bdccee4
Astyle formatting.
2009-03-22 15:15:16 +02:00
Gianluca Scacco
416115e38f
Fixed error compiling testautovariables
2009-03-22 12:00:21 +01:00
Daniel Marjamäki
da06c12925
refactoring error messages
2009-03-21 18:31:28 +01:00
Daniel Marjamäki
aee39ae929
refactoring - handling the stlOutOfBounds error message the new way
2009-03-21 14:20:10 +01:00
Daniel Marjamäki
bcad5afb26
refactoring - fixed the unit tests
2009-03-21 14:02:58 +01:00
Daniel Marjamäki
9f1c3cc535
refactoring the rest of the classes
2009-03-20 18:16:21 +01:00
Daniel Marjamäki
21dff96e7b
refactoring checkbufferoverrun
2009-03-20 17:35:53 +01:00
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