Commit Graph

495 Commits

Author SHA1 Message Date
Daniel Marjamäki 9e6ea07c14 CheckClass::noMemset: Refactoring so it handles more complex std template types 2010-02-04 21:49:58 +01:00
Daniel Marjamäki da7e75f69e Class checking: Minor refactoring when analysing memset on class 2010-02-04 20:53:04 +01:00
Daniel Marjamäki 9943262da0 Fixed #1287 (Use of memset on struct - std template types not handled) 2010-02-04 19:40:35 +01:00
Daniel Marjamäki 0ba665d77f Fixed #1337 (Division by zero with __alignof__()) 2010-02-03 21:23:44 +01:00
Daniel Marjamäki d3b5889f88 Fixed #1345 (Not initialised variables warning missing in classes with dllexport) 2010-02-03 20:01:56 +01:00
Daniel Marjamäki b01af012cd Fixed #1342 (Superclass constructors in initializer lists are considered unused functions when superclass has a namespace.) 2010-02-03 18:37:48 +01:00
Robert Reif f2eac901c0 Fixed #1343 (simplifyTypedef doesn't support deeply nested classes) 2010-02-03 07:58:36 +01:00
Daniel Marjamäki 4ec94116f5 Fixed #1341 (false positive 'uninitialized variable' when using Exception specifications) 2010-02-02 19:56:41 +01:00
Robert Reif b704fc7bc7 Fixed #1339 (add nested struct support to simplifyEnum and simplifyTypedef) 2010-02-01 19:59:24 +01:00
Daniel Marjamäki 1b9afc82a4 Reverted 4f30468c80. There was false positives such as #1335 so please fix them and then re-commit. 2010-02-01 19:46:51 +01:00
Robert Reif 64afcc8179 Fixed #1338 (simplify typedefs with global and nested namespace) 2010-01-31 21:46:18 +01:00
Daniel Marjamäki 1375a60e3f Fixed #1004 (improve check: Unintialized variable not detected when using a reference (&)) 2010-01-31 16:29:12 +01:00
Monika Lukow 25822dff24 Fixed #1249 (false positive '(error) Resource leak: f' for 'popen' / 'if(pclose(f) < 0)' sequence) 2010-01-31 11:44:30 +01:00
Monika Lukow a0e96be0c3 Fixed #1274 (false positive: Dangerous usage of strncat) 2010-01-31 11:43:54 +01:00
Monika Lukow 4f30468c80 Fixed #1094 (Improve check: unusual pointer arithmetic: 'ch+str') 2010-01-31 11:42:02 +01:00
Daniel Marjamäki 1a59e1bc68 Tokenizer: remove redundant assignments and variables 2010-01-31 09:52:19 +01:00
Daniel Marjamäki e15a16eb15 Tokenizer: Remove redundant assignments and variables 2010-01-31 09:33:57 +01:00
Daniel Marjamäki e1efad0c27 Tokenizer: remove the keyword 'inline' 2010-01-31 08:11:29 +01:00
Robert Reif d17d199415 Tokenizer: fix for multiple array definitions for a single typedef 2010-01-31 07:16:19 +01:00
Robert Reif 630d9ba552 Fixed #1326 (remove simplified enum definitions) 2010-01-31 07:13:09 +01:00
Robert Reif 7cbdb9f8a1 Fixed #1331 (simplify typedef of complex arrays) 2010-01-30 19:41:22 +01:00
Daniel Marjamäki 48f3921c36 Null pointer dereference: sending to output stream 2010-01-30 14:40:33 +01:00
Daniel Marjamäki 8716c771a4 Tokenizer: improved the simplifyInitVar 2010-01-30 14:25:11 +01:00
Daniel Marjamäki 3b08712930 Fixed #1005 (improve check: nullpointer dereference not found when it is initialized with NULL-cast) 2010-01-30 09:33:16 +01:00
Robert Reif 882e2225e0 Fixed 1329 (simplify typedef of function pointer returning template) 2010-01-30 08:00:11 +01:00
Daniel Marjamäki f9d5fb3191 Fixed #1327 (False positive: Redundant code: Found a statement that begins with numeric constant) 2010-01-29 22:28:49 +01:00
Reijo Tomperi 6e48f57826 Remove debug print 2010-01-29 23:24:16 +02:00
Reijo Tomperi 1d5ba4e320 Improved updateClassList(), but not yet took it into use.
findClassFunction is now non-static.
updateClassList usage is currently commented out as it doesn't handle class inside a function
2010-01-29 23:22:18 +02:00
Daniel Marjamäki f561441d90 Fixed #1319 (false negative: missing const not found) 2010-01-29 19:38:56 +01:00
Daniel Marjamäki 53f514fc5c Tokenizer: Fixed const simplification 2010-01-29 19:34:43 +01:00
Robert Reif 94c5d92b2b Fixed #1323 (segfault with style in CheckClass::operatorEqRetRefThis()) 2010-01-29 16:04:27 +01:00
Robert Reif 19bb2940cc Fixed #1325 (Segmentation fault in simplifyTypedef due to bad preprocessing) 2010-01-29 16:00:48 +01:00
Robert Reif fc54ed1eef Fixed #1326 (remove simplified enum definitions) 2010-01-29 15:57:26 +01:00
Daniel Marjamäki 9d11492845 Fixed #1286 (Memory leak not detected) 2010-01-27 22:05:04 +01:00
Daniel Marjamäki 15b4abd6d3 killerbot: Fixed #1314 (specify the files to check in 1 input file) 2010-01-27 21:43:01 +01:00
Daniel Marjamäki e49f7bfa0e Fixed #1315 (mismatched allocation and deallocaton not detected) 2010-01-27 21:02:13 +01:00
Daniel Marjamäki 7ec27cb43b updated --doc output about new checks in 1.40 2010-01-27 19:25:48 +01:00
Daniel Marjamäki 1c84dc814c Auto variables: Improved handling of temporaries 2010-01-27 19:16:32 +01:00
Robert Reif 45b6b9e5a1 Fixed #1316 (### Internal error in Cppcheck. Please report it.) 2010-01-27 19:03:24 +01:00
Daniel Marjamäki 32fcb8fe18 Auto variables: returning pointer to temporary .c_str() data 2010-01-26 22:11:34 +01:00
Daniel Marjamäki fa305d70bc Fixed #1302 (False positive: Confusion between POSIX open() and class member) 2010-01-26 20:10:52 +01:00
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