Daniel Marjamäki
db0466eb19
Fixed #1278 (Confusing style message formatting)
2010-01-26 19:37:22 +01:00
Daniel Marjamäki
e12d115e9a
Fixed #1312 (false positive: missing const message on functions returning references)
2010-01-25 21:40:57 +01:00
Robert Reif
8be8c266ac
Fixed #1313 (unnamed enums not simplified properly)
2010-01-25 07:45:16 +01:00
Robert Reif
989e8393e4
Fixed #1307 (Internal error with typedef in parameter list)
2010-01-24 22:40:35 +01:00
Daniel Marjamäki
724c55b32a
Memory leaks: some refactorings and minor improvements
2010-01-24 21:48:39 +01:00
Daniel Marjamäki
65881b9346
Fixed #1238 (False Negative : memory leak with template class)
2010-01-24 20:04:09 +01:00
Daniel Marjamäki
6d9740adea
Tokenizer: Fixed Tokenizer::simplifyKnownVariable bug when the variable is re-assigned in a loop
2010-01-24 19:27:39 +01:00
Daniel Marjamäki
7ce4825f95
Fixed #1308 (False positive: The function 'x' can be const for a static member function)
2010-01-24 18:26:39 +01:00
Daniel Marjamäki
25ba399a50
const class functions: refactorings
2010-01-24 13:45:56 +01:00
Daniel Marjamäki
b4b97e5706
const: fixed false positive when using increment/decrement
2010-01-24 13:33:30 +01:00
Reijo Tomperi
24052c16b4
Fix some style errors found from our own code.
2010-01-23 23:44:08 +02:00
Daniel Marjamäki
a0d8f44603
CheckClass: The operator< etc member functions can often be const
2010-01-23 22:36:04 +01:00
Reijo Tomperi
7817d5b142
Fix #1279 (Change error message: Invalid number of character ({). Can't process file.)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1279
2010-01-23 23:18:11 +02:00
Daniel Marjamäki
4d7ac2f82e
STL: fixed false positive when using erase
2010-01-23 22:03:38 +01:00
Daniel Marjamäki
43c8fe895c
Fixed #1301 (False positive: Data is allocated but not initialized)
2010-01-23 21:25:17 +01:00
Daniel Marjamäki
aab05524e5
Fixed #1305 (False positive: The function 'x' can be const when indirectly calling a non-const member)
2010-01-23 21:08:40 +01:00
Daniel Marjamäki
9a6b450501
Fixed #1304 (False positive: The function 'x' can be const when modifing a member)
2010-01-23 20:59:20 +01:00
Daniel Marjamäki
5b76be4935
Fixed #1303 (False positive: The function 'x' can be const for a constructor)
2010-01-23 20:47:29 +01:00
Daniel Marjamäki
f62466493b
New Check: Detect return of invalid reference
2010-01-23 20:39:12 +01:00
Daniel Marjamäki
fb10396cb3
only run CheckClass::checkConst if style checking is on
2010-01-23 09:38:35 +01:00
Daniel Marjamäki
35c303943f
Partial fix for #13 - detect simple cases of member functions that can be const
2010-01-23 09:19:22 +01:00
Daniel Marjamäki
037ecffc34
detect when function pointer that is null is used
2010-01-23 09:15:30 +01:00
Daniel Marjamäki
7b986c831d
Report when using uninitialized function pointer
2010-01-23 07:57:57 +01:00
Daniel Marjamäki
8a9eba980b
Function pointers: re-enabled the simplifyFunctionPointers
2010-01-23 07:43:12 +01:00
Robert Reif
13ca2510cc
Fixed #1298 ((error) ### Internal error in Cppcheck. Please report it. (typedef in fun proto))
2010-01-22 20:26:07 +01:00
Daniel Marjamäki
1552c0f7f2
Fixed #1276 (False Uninitialized variable when using goto)
2010-01-22 20:20:43 +01:00
Daniel Marjamäki
e9c8e1d8b1
doxygen and minor refactorings
2010-01-22 19:29:24 +01:00
Daniel Marjamäki
59de7934b7
Fixed #643 (Member variable not initialized not detected if any unknown function called)
2010-01-22 18:51:25 +01:00
Robert Reif
9f853cb164
Fixed #1297 (typedef causes internal error in vlc/modules/access/imem.c)
2010-01-22 17:27:40 +01:00
Daniel Marjamäki
d4b13eee9f
Fixed #1290 (1.40: Internal error)
2010-01-21 20:05:32 +01:00
Daniel Marjamäki
2e707974d0
Fixed #1273 (scope of variable limited not detected in latest versions)
2010-01-21 18:50:56 +01:00
Robert Reif
9f0b9551cf
This patch simplifies the function pointer return type code and allows more complex return types.
2010-01-21 18:01:09 +01:00
Robert Reif
e9e64033e7
Improved typedef simplification of function pointers
2010-01-21 07:51:08 +01:00
Daniel Marjamäki
a6e81c2ee7
Fixed #1293 (Things to add to call_func_white_list)
2010-01-20 22:03:06 +01:00
Daniel Marjamäki
3447030564
Merge branch 'master' of git@github.com:danmar/cppcheck
2010-01-20 21:19:32 +01:00
Daniel Marjamäki
96359b14ff
Simplify function pointers
2010-01-20 21:19:06 +01:00
Robert Reif
e163f878ab
Handle/simplify function pointer typedefs
2010-01-20 21:16:40 +01:00
Reijo Tomperi
b83d257852
Fix #1296 (false positive: index out of bounds)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1296
2010-01-20 21:26:54 +02:00
Daniel Marjamäki
85fcd4c9a9
Fixed #1282 (False positive for a memory leak in a simple loop)
2010-01-19 19:08:03 +01:00
Daniel Marjamäki
f49cc7f0ff
CheckMemoryLeak: Added 'scanf' and 'sscanf' to the whitelist
2010-01-18 21:58:27 +01:00
Daniel Marjamäki
32604dd55e
Fixed #1266 ('qsort' missing in call_func_white_list)
2010-01-18 21:34:11 +01:00
Daniel Marjamäki
53d036fadf
Added Cppcheck::terminate function that will terminate the checking ASAP
2010-01-18 20:23:50 +01:00
Robert Reif
cd31cd9298
Fixed #1251 (tokenize typedef of reference)
2010-01-18 19:06:50 +01:00
Daniel Marjamäki
fbf428550a
Fixed #1262 (cppcheck false positives: 'Possible null pointer dereference', 'Uninitialized variable')
2010-01-17 19:08:45 +01:00
Daniel Marjamäki
f3e25a5244
Fixed doxygen error messages
2010-01-17 16:38:28 +01:00
Daniel Marjamäki
25bf50755e
Reformatting the --doc output to work better in the wiki
2010-01-17 14:56:56 +01:00
Daniel Marjamäki
5595a17e41
Updated version to 1.40
2010-01-17 13:52:28 +01:00
Robert Reif
70dbb8ba17
Fixed #1275 (Cppcheck hangs when analysing the code 'typedef struct { } A, *B, **C;')
2010-01-17 08:16:17 +01:00
Daniel Marjamäki
fbefb8df34
Fixed #1272 (links in typedef not handled correctly)
2010-01-16 19:42:37 +01:00
Daniel Marjamäki
0a8ca1f160
Fixed #1271 (SIGSEGV on malformed source (macro stub + fundef))
2010-01-16 13:56:57 +01:00
Robert Reif
a0caea4ee6
Refactoring the handling of typedefs
2010-01-16 09:18:21 +01:00
Daniel Marjamäki
81ca6e9f98
Revert "minor tweak in Borland C++ project file"
...
This reverts commit ad06ee4f71
.
2010-01-16 08:47:46 +01:00
Daniel Marjamäki
ad06ee4f71
minor tweak in Borland C++ project file
2010-01-16 08:17:40 +01:00
Reijo Tomperi
d37864f8c4
Fix part of #1262 (cppcheck false positives: 'Possible null pointer dereference'
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1262
2010-01-15 23:46:47 +02:00
Daniel Marjamäki
f591d8f8e1
refactoring
2010-01-14 22:04:58 +01:00
Daniel Marjamäki
7059dd5693
astyle formatting
2010-01-14 22:01:59 +01:00
Daniel Marjamäki
b9f09679c7
lanurmi: Fixed #1269 (Changes required for compiling with Sun's compiler)
2010-01-14 22:00:14 +01:00
Daniel Marjamäki
ac077d3160
Fixed #1264 (False positive: Resource leak with if-else in while)
2010-01-14 21:41:50 +01:00
Daniel Marjamäki
a7bddc8fd3
Fixed #1268 (Null pointer dereference false positive)
2010-01-14 20:02:38 +01:00
Daniel Marjamäki
bc5800004b
wrote comments about the preprocessor
2010-01-13 21:50:44 +01:00
Daniel Marjamäki
cefa695dba
Fixed #1265 ((error) Uninitialized variable on macro expansion)
2010-01-13 19:37:55 +01:00
Robert Reif
0212225859
Tokenizer: fixed typedef issues
2010-01-13 07:59:47 +01:00
Daniel Marjamäki
1aac8f3e52
Uninitialized variables: disable subfunction analysis if multiple threads are used
2010-01-12 22:33:47 +01:00
Daniel Marjamäki
0638bc2112
CheckMemoryLeaks: Added 'strlen' to white list
2010-01-12 22:10:59 +01:00
Daniel Marjamäki
fd5e3e63b8
Fixed #1258 ('fscanf' missing in call_func_white_list)
2010-01-12 21:56:22 +01:00
Daniel Marjamäki
2de49129dc
Fixed #1259 (false postive: Member variable 'A::b' is not assigned a value in 'A::operator=')
2010-01-12 21:36:40 +01:00
Daniel Marjamäki
2358c51694
Tokenizer: some cleanup of std::
2010-01-12 21:25:31 +01:00
Daniel Marjamäki
374def4a53
Fixed #1070 (Improve scope error message)
2010-01-12 19:34:33 +01:00
Daniel Marjamäki
814eb6caee
Fixed #1257 (potential leaks not reported becauseof 'continue' in loop)
2010-01-12 19:12:08 +01:00
Robert Reif
5e8e4fd3e9
Fixed #1252 (Internal error in Cppcheck while parsing struct)
2010-01-12 17:38:36 +01:00
Robert Reif
7b6bf80057
Fixed #1250 (tokenize typedef of union)
2010-01-11 22:58:57 +01:00
Daniel Marjamäki
d3b7f5931f
Fixed #1174 (improve check: Unintialized variable not detected in subfunction)
2010-01-11 22:28:07 +01:00
Daniel Marjamäki
c666a9662b
BufferOverrun: negative index is out of bounds
2010-01-11 21:18:07 +01:00
Daniel Marjamäki
b8b6b0ec32
Uninitialized variables: fixed false positives when using pointer aliasing
2010-01-11 19:25:01 +01:00
Robert Reif
94d5e32aa1
Fixed #1248 (tokenize typedef of array)
2010-01-11 17:09:04 +01:00
Daniel Marjamäki
8be54b592d
ExecutionPath: better handling of for/while/do/switch, it doesn't bail out everything
2010-01-10 22:05:51 +01:00
Daniel Marjamäki
c5966bba59
Fixed #1225 (false negative :: uninitialized variable not detected when using enums)
2010-01-10 20:36:15 +01:00
Daniel Marjamäki
3fb420cbf0
fixed unlogged errors from the tokenizer and also some errors reported by valgrind
2010-01-10 20:03:46 +01:00
Daniel Marjamäki
a50ec2eded
memory leaks: better handling of loops and switch
2010-01-10 15:40:50 +01:00
Daniel Marjamäki
f65bf6d565
Fixed #1220 (False memory leak when using while)
2010-01-10 14:00:32 +01:00
Daniel Marjamäki
3fabe53570
Memory leaks: Better handling of switch
2010-01-10 10:37:54 +01:00
Daniel Marjamäki
b82cb2e41e
Fixed #1218 (Improve check: incrementing uninitialized variable i++)
2010-01-10 09:09:37 +01:00
Robert Reif
19ba151531
Fixed #1244 (tokenize typedef of unnamed struct)
2010-01-10 08:49:02 +01:00
Daniel Marjamäki
4c641ed80c
Fixed #1189 (false negative: using uninitialized variable i 'a[i] = 0;')
2010-01-09 22:26:05 +01:00
Daniel Marjamäki
0908728601
Fixed #1231 (Preprocessor: Fail to evaluate '#if ! defined _ABCD_')
2010-01-09 21:54:20 +01:00
Daniel Marjamäki
6ec5b797ab
Borland C++: Fixed compiler error
2010-01-09 10:24:35 +01:00
Daniel Marjamäki
2dd0907146
fixed segmentation fault
2010-01-08 21:54:24 +01:00
Daniel Marjamäki
ca74f57fd0
Fixed #1237 (Uninitialized variable false positive for return-value pattern in pan source code.)
2010-01-08 21:24:48 +01:00
Robert Reif
60ef3ef872
Fixed #1233 (false positive: operator = should check for assignment to self)
2010-01-08 19:15:24 +01:00
Daniel Marjamäki
686137415f
Fixed #1235 (CheckMemoryLeakInFunction: Wrong handling of 'fcloseall')
2010-01-07 21:36:51 +01:00
Robert Reif
b30b07beee
Fixed #1232 (segmentation fault of cppcheck when scanning templates)
2010-01-07 18:09:35 +01:00
Daniel Marjamäki
b366dba682
After suggestion from Jim Vollner, remove dead pointers from the used list
2010-01-06 21:29:39 +01:00
Daniel Marjamäki
94b0cbbcff
uncomment validation of Tokenizer::_tokensBack
2010-01-06 21:18:42 +01:00
Daniel Marjamäki
57d1da3910
Ticket #1228 : Handle tokensBack in the Token class. When adding&removing tokens the Token class can make sure that this pointer is updated accordingly. It is very important that the tokensBack has the same scope as the token list, otherwise there will be a dead pointer problem.
2010-01-06 20:19:27 +01:00
Daniel Marjamäki
485f3c7708
Fixed #1221 ([False positive] Member variable not initialized with operator[] gives wrong result)
2010-01-06 19:04:15 +01:00
Reijo Tomperi
ff0573998a
Added more validating code to tokenizer. Currently commented out.
2010-01-06 01:32:05 +02:00
Robert Reif
e6cc897e29
Fixed #1224 (segmentation fault of cppcheck)
2010-01-05 21:55:33 +01:00
Robert Reif
13f627d0d5
Fixed #1215 (are enums processed properly?)
2010-01-04 17:22:06 +01:00
Kimmo Varis
488ea55358
CMake - add header files to lib project (and to VS project).
2010-01-03 21:08:49 +02:00
Daniel Marjamäki
e248f7d3e5
Fixed #1023 (improve check: Unintialized variable not detected when using +=)
2010-01-03 18:49:13 +01:00
Daniel Marjamäki
e286896d75
Fixed #1216 (false positive: uninitialized variable when using exit|abort)
2010-01-03 15:35:32 +01:00
Daniel Marjamäki
fa535ff3ae
Fixed #440 (NULL referencing not detected)
2010-01-03 13:30:20 +01:00
Robert Reif
2a546dc9c0
Fixed #1184 (improve test: operator =)
2010-01-03 08:26:02 +01:00
Daniel Marjamäki
1032eb2449
Fixed #1214 (false positive: uninitialized variable 'bool fixed = std::ios_base::fixed;')
2010-01-03 08:03:28 +01:00
Daniel Marjamäki
38b480a4b5
Fixed #1203 (Preprocessor: Doesn't handle macros usage that contain ';')
2010-01-02 20:54:52 +01:00
Daniel Marjamäki
d82079e86f
Fixed #1209 (False positive: uninitialized variable c when it is initialized with 'ab(sizeof(xyz), &c)')
2010-01-02 18:16:44 +01:00
Robert Reif
bcafb30d0d
Fixed #1211 (add struct support for constructor checks)
2010-01-02 17:29:55 +01:00
Daniel Marjamäki
2e62a3f4c7
Fixed #1202 (false positive: uninitialized variable when using 'do')
2010-01-02 09:08:36 +01:00
Daniel Marjamäki
6af5e434d8
Fixed #1204 (Tokenizer::findClassFunction broken)
2010-01-02 08:33:54 +01:00
Slava Semushin
82ae064218
Fixed #1013 (autovariables: detect when assigning parameter **par)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1013
2010-01-02 03:53:34 +06:00
Slava Semushin
b816968f28
Fixed #1197 (Segmentation fault when we define function which was already defined by preprocessor)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1197
2010-01-02 03:25:37 +06:00
Daniel Marjamäki
ddfd0b948e
Fixed #1178 (1.39: Internal error)
2010-01-01 21:06:30 +01:00
Daniel Marjamäki
071b7b463d
Fixed #1200 (false positive 'uninitialized variable' when using throw)
2010-01-01 20:12:39 +01:00
Daniel Marjamäki
b0d7623dcf
refactoring the fix for #1191
2010-01-01 19:49:33 +01:00
Daniel Marjamäki
f8bd59f5b5
Fixed #1191 (false positive: uninitialized variable)
2010-01-01 19:43:02 +01:00
Daniel Marjamäki
77c5b793c9
Fixed #1196 (Hang: Cppcheck hang for the file linux-2.6/drivers/crypto/hifn_795x.c)
2010-01-01 13:26:54 +01:00
Daniel Marjamäki
7ecd333ffa
Fixed #1188 (false negative: dereferencing p, which is a null pointer 'int y = 5 + *p')
2009-12-31 20:00:20 +01:00
Daniel Marjamäki
e0ecef5d71
fixed a hang in Tokenizer::simplifyFunctionParameters
2009-12-31 19:31:21 +01:00
Robert Reif
12641e2d76
Fixed #1184 (improve test: operator =)
2009-12-31 13:44:03 +01:00
Daniel Marjamäki
f797794601
fixed cppcheck warning
2009-12-31 13:34:43 +01:00
Daniel Marjamäki
ee1675270b
Fixed #1181 (Preprocessor fails while expanding macros)
2009-12-31 12:45:17 +01:00
Daniel Marjamäki
0159287437
Fixed #1183 (False positive: uninitialized variable p 'd = bar(sizeof(*p));')
2009-12-31 09:10:20 +01:00
Daniel Marjamäki
0ee3d7e46a
Fixed #1182 (False positive: uninitialized variable 'int *pa = &a;')
2009-12-30 21:42:15 +01:00
Daniel Marjamäki
6c0919d9bd
Fixed #1173 (Improve check: memory leak not detected in constructor)
2009-12-30 21:29:54 +01:00
Robert Reif
f8f0a31e41
Fixed #1167 (### Internal error in Cppcheck. Please report it.)
2009-12-30 20:56:16 +01:00
Daniel Marjamäki
71a83647c6
cleanup
2009-12-30 20:38:16 +01:00
Daniel Marjamäki
ae3ff7d376
Fixed #1087 (uninitialized data not detected 'char z = *str')
2009-12-30 20:37:11 +01:00
Daniel Marjamäki
461d826eff
Fixed #1105 (improve check: uninitialized variable not detected for 'a = a')
2009-12-30 20:15:44 +01:00
Robert Reif
3a46ef0487
Fixed #1176 (void operator = check doesn't support struct)
2009-12-30 18:40:02 +01:00
Daniel Marjamäki
d83131ca92
Fixed #1041 (passing a nullpointer to a reference)
2009-12-30 17:42:41 +01:00
Daniel Marjamäki
a7ab47bb98
Fixed #1067 (Tokenizer: K&R style function that returns function pointer)
2009-12-30 15:12:38 +01:00
Daniel Marjamäki
06ee643c6a
Fixed #1177 (False positive: pointer is not dereferenced 'sizeof(*p)')
2009-12-30 11:32:46 +01:00
Daniel Marjamäki
2de2ecafe4
Fixed #1168 (false positive: Uninitialized variable)
2009-12-30 08:24:27 +01:00
Daniel Marjamäki
2a28ca72cc
Fixed #1166 (improve check: using uninitialized pointer to create reference 'int &r(*p);')
2009-12-29 20:36:20 +01:00
Daniel Marjamäki
71b328d703
Robert Reif: Fixed #1163 (post increment test broken for complex template types)
2009-12-29 19:24:48 +01:00
Daniel Marjamäki
160f795710
Fixed #1165 (Tokenizer: wrong simplification of 'do { .. } while (0)' if the body contains continue or break)
2009-12-29 12:15:39 +01:00
Daniel Marjamäki
4cbae159b2
ExecutionPath: Refactoring. Removed the bailOut variable
2009-12-29 09:30:02 +01:00
Daniel Marjamäki
cfdf2b8cfe
Fixed #1160 (Null pointer dereference vs. goto)
2009-12-29 09:17:07 +01:00
Daniel Marjamäki
58e85d55e3
astyle formatting
2009-12-29 07:50:33 +01:00
Daniel Marjamäki
905533552d
Robert Reif: Fixed #1164 (only first void operator = found)
2009-12-29 07:48:37 +01:00
Daniel Marjamäki
84ce6ba75a
Robert Reif: Fixed #1162 (add support to tokenize typedefs with templates)
2009-12-29 07:28:00 +01:00
Daniel Marjamäki
d3d3ad101f
Valgrind: Fixed memory leaks when running testrunner that was found by Valgrind
2009-12-28 19:48:30 +01:00
Daniel Marjamäki
61e61c1584
Robert Reif: Fixed #1158 ((possible style) message with regular check)
2009-12-28 18:06:26 +01:00
Daniel Marjamäki
28f2bf2150
Robert Reif: Fixed #1161 (add tokenize support for typedefs with enum definitions)
2009-12-28 17:57:52 +01:00
Daniel Marjamäki
6a31fe6403
Fixed #1159 (Valgrind gives error in Tokenizer::simplifyWhile0)
2009-12-28 16:32:34 +01:00
Daniel Marjamäki
9aca2e7680
Fixed #1156 ([False positive] Uninitialized variable - class member in constructor)
2009-12-28 12:51:28 +01:00
Daniel Marjamäki
6fd74dce47
exitcode suppressions. Partly fixes #1113
2009-12-28 11:26:52 +01:00
Daniel Marjamäki
197bcf17ba
Tokenizer: Simplify 'while (0)' better
2009-12-28 08:37:34 +01:00
Daniel Marjamäki
b1e963fe2c
Fixed another issue with #1154 (false positive: Data is allocated but not initialized)
2009-12-27 18:00:43 +01:00
Daniel Marjamäki
24c5f4d53c
astyle formatting
2009-12-27 17:46:24 +01:00
Daniel Marjamäki
1c0f3ee179
Fixed #1154 (false positive: Data is allocated but not initialized)
2009-12-27 17:35:18 +01:00
Daniel Marjamäki
738987a686
Fixed #1138 (improve check: dereferencing uninitialized pointer)
2009-12-27 17:20:34 +01:00
Martin Ettl
c3886a5803
added further testcases to testmathlib::convert(); now the conversion of +-[hexnumber|octalnumber] works correctly
2009-12-27 15:18:18 +01:00
Martin Ettl
c2b3cfccc9
extended testcases of mathlib; fixed zero conversion: +0 and -0 is converted to 0
2009-12-27 14:30:23 +01:00
Daniel Marjamäki
c7cede1d76
Fixed #972 (New check: return pointer of stack memory)
2009-12-27 13:08:41 +01:00
Daniel Marjamäki
dccba65502
Uninitialized variables: Refactoring and commenting a little
2009-12-27 10:48:44 +01:00
Daniel Marjamäki
fbfe5a4bd1
Fixed #1153 (False positive: uninitialized data for reinterpret_cast)
2009-12-27 09:27:05 +01:00
Daniel Marjamäki
ab7ffd2391
Uninitialized variables: Fixed false positive for 'if (ptr)'
2009-12-26 16:22:14 +01:00
Daniel Marjamäki
a82a085d10
Fixed #1151 (false positive: Data is allocated but not initialized)
2009-12-26 09:30:02 +01:00
Daniel Marjamäki
ad8184f060
Fixed #1152 (Hang/Slow: ExecutionPath handling hangs)
2009-12-26 08:37:59 +01:00
Daniel Marjamäki
9819b75e17
ExecutionPath: Refactoring if-handling
2009-12-25 20:50:23 +01:00
Daniel Marjamäki
7bf0622ae0
ExecutionPath: Refactoring the interface
2009-12-25 20:12:06 +01:00
Daniel Marjamäki
b5291825ce
Fixed #683 (wrong usage of strcmp)
2009-12-25 19:45:21 +01:00
Daniel Marjamäki
5925b88b38
Robert Reif: improve check: array index out of bounds, show name of array, array size and array index
2009-12-25 15:25:58 +01:00
Daniel Marjamäki
1a25e40180
Robert Reif: fix cppcheck post increment warning
2009-12-25 15:19:36 +01:00
Daniel Marjamäki
44a629ec74
Fixed #1141 (Tokenizer: Wrong simplification of calculations)
2009-12-25 14:47:15 +01:00
Daniel Marjamäki
9b05850e97
fixed unit testing
2009-12-23 20:00:12 +01:00
Daniel Marjamäki
ea51c3e098
Refactoring the uninitialized variable / null pointer checks so they use a common function to inspect function calls
2009-12-23 19:51:32 +01:00
Daniel Marjamäki
a7d48f2eb4
Fixed #1147 (Improve check: return uninitialized variable)
2009-12-23 17:55:03 +01:00
Daniel Marjamäki
b6c320de8a
Fixed false positives about uninitialized variables
2009-12-23 15:01:23 +01:00
Daniel Marjamäki
ef21ba7425
Fixed #1137 (false positive: uninitialized variable when using a class object)
2009-12-23 13:57:01 +01:00
Daniel Marjamäki
5a89cc3259
Robert Reif: Fixed #1139 (false negative: CheckOther::postIncrement() only finds at most one problem)
2009-12-23 13:38:54 +01:00
Daniel Marjamäki
4419f4a342
Robert Reif: fix a style warning
2009-12-23 12:16:02 +01:00
Daniel Marjamäki
d2dc5806cd
Borland C++: Fixed compiler error
2009-12-22 23:21:52 +01:00
Daniel Marjamäki
305ef25208
Visual Studio: Added casts to silence compiler warnings
2009-12-22 22:44:21 +01:00
Daniel Marjamäki
cd2e501794
Visual Studio: Fixed unittests
2009-12-22 21:56:00 +01:00
Daniel Marjamäki
2bd60ab6c8
Fixed #1133 (Uninitialized array: strchr, strrchr, etc)
2009-12-22 21:08:29 +01:00
Daniel Marjamäki
566cfce8da
Fixed #1128 (false positive: Data is allocated but not initialized)
2009-12-22 21:00:52 +01:00
Daniel Marjamäki
c05aebbc0a
Fixed #1112 (cppcheck fails because of accented characters in comments)
2009-12-22 20:38:12 +01:00
Daniel Marjamäki
4dac46b2d7
Fixed #1127 (Segfault with template)
2009-12-22 20:10:08 +01:00
Daniel Marjamäki
11da89784f
Eric Sesterhenn: Fixed #1130 (False positive uninitialized variable)
2009-12-22 19:16:34 +01:00
Daniel Marjamäki
b4b63789fc
Eric Sesterhenn: Fixed #1131 (descriptor leak false positive)
2009-12-22 19:13:46 +01:00
Daniel Marjamäki
5b87a51aa5
Robert Reif: Fixed #1108 (Only trivial typedefs are tokenized properly)
2009-12-22 19:10:33 +01:00
Daniel Marjamäki
2e0566bf7a
Fixed #1096 (Non-obvious error message: Overlapping data buffer)
2009-12-21 21:05:55 +01:00
Daniel Marjamäki
72bf1c1dbe
Fixed #1095 (Non-obvious error message: Dangerous usage of erase)
2009-12-21 20:49:16 +01:00
Daniel Marjamäki
f5f8d857c1
preprocessor: removed unnecessary casts
2009-12-21 20:26:57 +01:00
Daniel Marjamäki
83d5a72659
Fixed #1126 (False positive: upon exception there is memory leak (calling unknown function))
2009-12-21 20:04:55 +01:00
Daniel Marjamäki
b3b07321ca
ericsesterhenn: Fixed #1091 (improve check: nullpointer dereference not detected)
2009-12-21 19:09:13 +01:00
Daniel Marjamäki
763e3d9eb5
Execution Path: Refactoring
2009-12-21 18:17:35 +01:00
Reijo Tomperi
df0d2ca83c
Fix #1124 (Invalid number of character ((). Can't process file.)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1124
2009-12-20 23:50:57 +02:00
Daniel Marjamäki
11c7b8a839
Execution Path: some refactorings of the checking
2009-12-20 19:44:32 +01:00
Daniel Marjamäki
d9cf70c1c6
Fixed #1119 (false positve: uninitialized variable y when y is assigned in inner expression 'x = (y = 10)')
2009-12-20 13:55:17 +01:00
Daniel Marjamäki
191a913ff9
Fixed #1117 (segmentation fault of cppcheck)
2009-12-20 12:45:34 +01:00
Kimmo Varis
9e2a42ebf9
CMake - use more strict compiler flags.
2009-12-20 10:45:57 +02:00
Daniel Marjamäki
d86234b7fd
Preprocessor: Use 'unsigned char' instead of 'char'
2009-12-20 09:35:51 +01:00
Daniel Marjamäki
74b9bccd07
code cleanup
2009-12-20 09:02:25 +01:00
Daniel Marjamäki
813c674611
stl size: minor fix to prevent segmentation fault when token is null
2009-12-19 19:27:12 +01:00
Daniel Marjamäki
ad225ea745
stl size: added documentation
2009-12-19 19:24:48 +01:00
Daniel Marjamäki
e7c0e4d482
Fixed #1093 (False positive: missing constructor)
2009-12-19 17:58:52 +01:00
Daniel Marjamäki
8a1940e043
astyle
2009-12-19 17:57:58 +01:00
Daniel Marjamäki
95f652a2b4
robert reif: Fixed #1118 (new check: use empty() instead of checking size() against zero)
2009-12-19 15:24:59 +01:00
Daniel Marjamäki
69a98d81fc
Fixed #1107 (False positive: Dangerous usage of erase, when using std::list)
2009-12-18 20:55:51 +01:00
Daniel Marjamäki
8665b36f54
lanurmi: Fixed #1016 (Patch: Refactor #ifdefs in filelister.cpp)
2009-12-18 18:52:09 +01:00
Daniel Marjamäki
d4adab3e78
added error info about the strncpy check
2009-12-18 17:33:33 +01:00
Daniel Marjamäki
0da0b5ffed
ericsesterhenn: Fixed #1106 (check if buffer is zero terminated after a strncpy)
2009-12-18 17:26:15 +01:00
Kimmo Varis
b619538aa3
CMake - add missing file in lib.
2009-12-17 20:19:55 +02:00
Kimmo Varis
a669ef0ed4
CMake - reorder files in lib's makefile.
2009-12-17 20:16:28 +02:00
Kimmo Varis
c85c0fbabc
Add simple CMake build files to build lib and cli.
...
Apparently not everybody wants to use QMake to build cppcheck. Which is
understandable if you only want to hack on/build lib and cli. Qt and QMake are
pretty lot to install for just that.
So lets start using CMake. It is widely used and is "just" build system and not
programming framework. CMake is also easy to use for building Qt software too
so it can replace QMake.
This first commit only builds lib and cli for Linux.
2009-12-15 22:27:17 +02:00
Daniel Marjamäki
1680d1fb42
Fixed #1086 (segmentation fault of cppcheck '#if define(A)+define(B)+define(C)!=1')
2009-12-15 20:18:32 +01:00
Daniel Marjamäki
e03ff727d4
Fixed #1103 (false positive: uninitialized variable when using references)
2009-12-15 19:50:48 +01:00
Daniel Marjamäki
368df4c083
TestLocalLeaks: going out of scope
2009-12-15 19:27:07 +01:00
Reijo Tomperi
64261e6909
Fix compiler error: cast from 'CheckLocalLeaks*' to 'int' loses precision
2009-12-15 00:57:32 +02:00
Daniel Marjamäki
9cb6102983
fixed #1099 (GUI: unable to build gui from current git-head)
2009-12-14 23:22:27 +01:00
Reijo Tomperi
30f789a168
Fix #1076 (Invalid number of character ({). Can't process file.)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1076
2009-12-15 00:06:05 +02:00
Daniel Marjamäki
0c13f9ba5c
Added TestLocalLeaks
2009-12-14 20:30:31 +01:00
Daniel Marjamäki
4dc8794c69
Fixed #1082 (False positive: Resource leak in loop which exits only after releasing resource)
2009-12-13 19:50:49 +01:00
Daniel Marjamäki
829a4f8453
Fixed #1084 (define configuration lost)
2009-12-13 17:18:27 +01:00
Daniel Marjamäki
b4a454fc47
Fixed #1058 (Preprocessor: extracting configuration for '#if DEF == 1')
2009-12-13 15:23:44 +01:00
Daniel Marjamäki
01cfa3b6bd
Fixed #1072 (False positive: class member initialization with '*p=0;')
2009-12-13 09:36:59 +01:00
Daniel Marjamäki
bc808710a0
Fixed #1097 (Internal error: When macro is not expanded 'ABC(for (i=0;i<10;i++) ..);')
2009-12-12 19:58:19 +01:00
Daniel Marjamäki
1002457b17
Fixed #1074 (Exception safety: auto deallocated classes don't leak)
2009-12-12 18:56:26 +01:00
Daniel Marjamäki
c6f913ac3e
Preprocessor: Fixed TODO_ASSERT_EQUALS
2009-12-11 22:32:44 +01:00
Daniel Marjamäki
4d185f0935
Fixed #1080 (false positive: member variable not initialized)
2009-12-11 21:34:04 +01:00
Daniel Marjamäki
9646f62ec1
Fixed #1075 (False positive: uninitialized variable 'return bar(s);')
2009-12-11 19:58:29 +01:00
Daniel Marjamäki
e52fb36c5c
Fixed #1060 (Preprocessor: wrong define handling)
2009-12-11 19:28:37 +01:00
Daniel Marjamäki
91114c50d2
Fixed #1061 (false positve: uninitialized variable)
2009-12-09 20:05:06 +01:00
Daniel Marjamäki
e2473314b5
Fixed #1024 (Preprocessor: doesn't expand macro in macro)
2009-12-09 19:14:07 +01:00
Daniel Marjamäki
418d93eafb
Preprocessor: Refactoring the Preprocessor::expandMacros
2009-12-09 17:13:48 +01:00
Reijo Tomperi
87325799c5
Fix #1071 ((style) The function 'throw' is never used)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1071
2009-12-08 23:41:47 +02:00
Reijo Tomperi
d08d1deab1
Apply patch from #1066 (Speed up cppcheck)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1066
2009-12-08 23:12:49 +02:00
Reijo Tomperi
db30c5b0d2
Fix #1069 (Minor spelling mistake across cppcheck)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1069
2009-12-08 20:10:08 +02:00
Reijo Tomperi
bd024b7a2d
Fix #1065 (Internal error - incrementing single char in char array)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1065
2009-12-07 23:42:30 +02:00
Daniel Marjamäki
e5c507dc02
Fixed #1063 (False positive: deallocated memory doesn't leak upon exception)
2009-12-07 19:23:33 +01:00
Reijo Tomperi
f5849f9be2
Fix #1057 (Tokenizer: negative numbers are not tokenized correctly in switch-case)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1057
2009-12-07 00:09:56 +02:00
Reijo Tomperi
e57d9609a7
small fix to previous commit
2009-12-06 22:32:38 +02:00
Reijo Tomperi
fc40808a8a
Minor refactoring for checkother.cpp
2009-12-06 22:28:38 +02:00
Daniel Marjamäki
8db35189e0
STL: fix iterator bug
2009-12-06 21:21:27 +01:00
Daniel Marjamäki
3100bb3ccc
Visual C++: Suppress compiler warnings
2009-12-06 20:34:02 +01:00
Daniel Marjamäki
3c063bfdb8
Preprocessor: Reverted refactoring
2009-12-06 20:10:10 +01:00
Daniel Marjamäki
046db9b2bb
Preprocessor: Fix so the unit tests work again
2009-12-06 19:53:17 +01:00
Daniel Marjamäki
bbc63b6b5b
twistedwave: Fixed #1055 (Support for inline suppressions)
2009-12-06 19:38:53 +01:00
Daniel Marjamäki
46b19e0184
Preprocessor: Refactoring to make it simpler
2009-12-06 19:17:59 +01:00
Daniel Marjamäki
2d180ab918
newcheck: added the 'newcheck' functionality. It's still in early state so it needs refactoring
2009-12-06 18:41:28 +01:00
Daniel Marjamäki
c2a37c5d69
class checking: It's a 'possible style' error if a private constructor is not initializing a member variable
2009-12-06 18:35:32 +01:00
Daniel Marjamäki
d94bc4c89f
version 1.39
2009-12-06 13:34:51 +01:00
Daniel Marjamäki
a30a64d280
suppress 'internal error' message about failed template instantiation in release mode
2009-12-06 11:44:53 +01:00
Daniel Marjamäki
cd4e355f17
Fixed #1052 (Internal error for 'int vals[] = { 0x13, 1?0x01:0x00 };')
2009-12-06 10:58:27 +01:00
Daniel Marjamäki
a5e43b4be5
Fixed #1051 (segmentation fault when there is syntax error)
2009-12-06 09:02:13 +01:00
Daniel Marjamäki
75f6e20e61
Fixed #1050 (Internal error: In tokenizer for: 'do { sizeof 1; } while (0);')
2009-12-06 08:46:59 +01:00
Daniel Marjamäki
e66156ab5c
Fixed #1049 (Tokenizer: internal error for 'std::list<std::string[8]> w1, w2;')
2009-12-05 22:19:54 +01:00
Daniel Marjamäki
da4d03f6c4
Fixed #1048 (False positive: exceptNew error with nothrow)
2009-12-05 22:05:59 +01:00
Daniel Marjamäki
e9b342c56b
Fixed #1046 (tokenizer: internal error for 'discard_block< (1 << 24), 10, 24 > u, v;')
2009-12-05 21:15:14 +01:00
Daniel Marjamäki
42093911d6
updated help about --enable
2009-12-05 20:08:52 +01:00
Daniel Marjamäki
aed06fbd86
Borland C++: fixed compiler error and updated the project file to include iterator debugging
2009-12-05 19:28:20 +01:00
Daniel Marjamäki
642469b93f
Fixed #1044 (Access violation with --enable=all)
2009-12-05 17:37:30 +01:00
Daniel Marjamäki
0b09c36851
Fixed #1026 (false positive: buffer access out of bounds)
2009-12-05 11:41:30 +01:00
Daniel Marjamäki
7f15fea735
Fixed #1043 (use cppcheck:.. syntax in error messages)
2009-12-05 08:08:28 +01:00
Daniel Marjamäki
052ce15176
--enable: readded code so that parameters can be comma separated
2009-12-04 21:31:14 +01:00
Daniel Marjamäki
737844d652
fix a bug in commit 84a6fe6b54
2009-12-04 20:12:34 +01:00
Daniel Marjamäki
84a6fe6b54
Fixed #1034 (change --enable to --enable=all)
2009-12-04 19:35:58 +01:00
Reijo Tomperi
54629ff221
Fix #1037 (tokenizing a nested do while, while loop fails)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1037
2009-12-04 00:06:03 +02:00
Reijo Tomperi
2b980f9abe
astyle fix
2009-12-03 22:48:52 +02:00
Daniel Marjamäki
48bb1fdc83
Eric Sesterhenn: Fixed #1032 (False positive resource leak with exit at end of function)
2009-12-03 19:19:20 +01:00
Daniel Marjamäki
96268b4caf
Fixed #1030 (wrong line number with goto)
2009-12-02 19:47:35 +01:00
Reijo Tomperi
f5c81429cb
Refactoring: Parse --enable values in Settings class
2009-11-30 23:48:58 +02:00
Reijo Tomperi
79c8f3dc16
Add --unused-functions back to help, but mention that it is deprecated.
2009-11-30 22:45:05 +02:00
Daniel Marjamäki
153a13272c
ericsesterhenn: Fix #1028 (False positive resource leak)
2009-11-30 16:45:19 +01:00
Daniel Marjamäki
ded2e68c2e
Fix #1022 (False positive: uninitialized variable when using local struct)
2009-11-29 19:23:31 +01:00
Reijo Tomperi
f1ae932f18
Fix #986 (Move --all and --style to --enable)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/986
2009-11-29 18:59:12 +02:00
Daniel Marjamäki
e6b5fe99f6
Fixed #1027 (Internal error: sizeof a++)
2009-11-29 17:25:35 +01:00
Daniel Marjamäki
f4943b8b9c
changed error message when there an internal error in Cppcheck is found
2009-11-29 16:13:14 +01:00
Daniel Marjamäki
e7d7507c65
Fixed #1020 (lib/tokenize.cpp:4615: bool Tokenizer::validate() const: Assertion 0 failed)
2009-11-29 12:14:42 +01:00
Reijo Tomperi
57aac9270a
validator bugs are now printed using the errorlogger
2009-11-28 23:08:43 +02:00
Daniel Marjamäki
f927375b7e
DJGPP: fix runtime errors because list is destroyed before objects
2009-11-28 19:43:13 +01:00
Reijo Tomperi
ee7b09fb8d
Use sizeOfType() instead of sizeof(void*)
2009-11-28 18:24:16 +02:00
Martin Ettl
03e7914c98
partial fix of ticket #997 ; added check for write() two testcases
2009-11-28 13:41:24 +01:00
Daniel Marjamäki
b0470d649a
mode change from 755 to 644
2009-11-28 12:56:34 +01:00
Daniel Marjamäki
f75c9619d1
Fixed #1021 (Out-of-bounds access false positive)
2009-11-28 12:51:23 +01:00
Daniel Marjamäki
6e175053c1
minor fixes
2009-11-28 11:47:44 +01:00
Daniel Marjamäki
3db49aee71
fixed buffer overrun and removed redundant function Token::str
2009-11-28 09:48:43 +01:00
Daniel Marjamäki
5ab8967632
Borland C++: Fixed compiler error
2009-11-28 08:55:51 +01:00
Reijo Tomperi
0bdf63d864
Token debug function printOut() can now print out filename instead of index
2009-11-28 00:04:04 +02:00
Reijo Tomperi
2c51542cf1
Fix #1018 (strcat(strcat()) causes assertion in Tokenizer::validate)
...
Test case provided by povaddict
http://sourceforge.net/apps/trac/cppcheck/ticket/1018
2009-11-27 23:21:13 +02:00
Daniel Marjamäki
c94ecfe1a3
Fixed #1015 (SIGABRT: Tokenizer::validate for openttd/src/ai/ai_config.cpp)
2009-11-27 17:32:53 +01:00
Daniel Marjamäki
7616246597
Fixed #1014 (Preprocessor: Invalid preprocessing of '#define some_delete(x) delete x;')
2009-11-26 17:32:18 +01:00
Reijo Tomperi
12a87fa3a4
Fix #1007 (False positive array index out of bounds concerning a switch statement in a for loop)
...
Bailout if switch is found in for loop.
http://sourceforge.net/apps/trac/cppcheck/ticket/1007
2009-11-25 22:40:51 +02:00
Daniel Marjamäki
128b2b8c59
Fixed #989 (CppCheck crashes on Win XP when scanning large directories/subdirectories)
2009-11-23 18:59:50 +01:00
Reijo Tomperi
2ff6ac9768
Fix #1003 (Compiler warning: is there a reason for Tokenizer::getErrorMessages to be virtual?)
...
Destructor is now virtual.
http://sourceforge.net/apps/trac/cppcheck/ticket/1003
2009-11-22 16:06:33 +02:00
Daniel Marjamäki
9b397afeca
Temporary fix for #994 (cppcheck cannot check my sources with segfaulting)
2009-11-22 13:38:45 +01:00
Daniel Marjamäki
7f6f41fd53
Fixed #993 (Latest Git drop aborts at 63% of wine tree)
2009-11-22 09:06:39 +01:00
Slava Semushin
334eaa35ef
lib/preprocessor.cpp: clean up code.
...
Improvements for: 092f64b77a
No functional change.
2009-11-22 01:14:29 +06:00
Daniel Marjamäki
092f64b77a
Fixed #982 (Preprocessor: detects and remove conditions which always true)
2009-11-21 19:53:07 +01:00
Slava Semushin
38a6c41730
Fixed #988 (Tokenizer::simplifyDoWhileAddBraces(): don't add braces after "do" when it not a loop)
...
FIXME: test cases needed.
http://sourceforge.net/apps/trac/cppcheck/ticket/988
2009-11-21 20:46:17 +06:00
Reijo Tomperi
9bdf4502ed
Fix #995 (false positive: buffer access out of bounds when using fgets)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/995
2009-11-21 15:45:52 +02:00
Reijo Tomperi
6417704577
Fix #985 (Detect buffer overrun with read())
...
http://sourceforge.net/apps/trac/cppcheck/ticket/985
2009-11-20 23:47:06 +02:00
Daniel Marjamäki
531d0fa685
Fixed #965 (Division by zero false positive with nested macros)
2009-11-20 20:42:28 +01:00
Slava Semushin
41b2a52915
Fixed #990 (Tokenizer::simplifyIfAddBraces() handle case where statement after if doesn't end by semicolon)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/990
2009-11-21 01:40:46 +06:00
Daniel Marjamäki
91f7c15c24
Fixed #960 (Tokenizer::validate() assertion failure with mismatched brackets)
2009-11-20 20:10:42 +01:00
Daniel Marjamäki
7890589693
Fixed #912 (### Unlogged error at Tokenizer::syntaxError: Invalid number of character (())
2009-11-20 19:18:57 +01:00
Slava Semushin
5369965e55
Fixed #983 (Tokenizer::simplifyTypedef() incorrectly substitute type inside namespace)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/983
2009-11-20 00:02:16 +06:00