Commit Graph

7797 Commits

Author SHA1 Message Date
Daniel Marjamäki 07b5ebe72b Check Function Usage: Removed much of the old checking and made some refactoring 2008-11-22 19:39:12 +00:00
Daniel Marjamäki 6687bc7b9a Function Usage: Added a new class for checking function usage 2008-11-22 18:51:01 +00:00
Daniel Marjamäki d68e2ae966 tokenizer: simplifyConditions tries to simplify conditions.. those that are always true to '( true )' and those that are always false to '( false )' 2008-11-22 17:53:22 +00:00
Daniel Marjamäki e33985dbf0 Memory leak: Handle conditions that are always true / false 2008-11-22 11:30:50 +00:00
Daniel Marjamäki 2db69e6072 tokenizer: Added DeallocateTokens to the destructor so it's not necessary to cleanup manually 2008-11-22 09:44:02 +00:00
Daniel Marjamäki 9ce8918895 tokenizer: Added functions "alwaysTrue" and "alwaysFalse" to check if a
condition is always true / false
2008-11-22 09:32:57 +00:00
Reijo Tomperi 125692bc65 Refactoring: CommonCheck.* files are removed. Rest of the global functions from there were moved to Tokenizer class 2008-11-21 21:14:24 +00:00
Daniel Marjamäki 66412ed4ae Memory leak: Added checking for 'fopen' and 'popen' 2008-11-21 18:17:40 +00:00
Daniel Marjamäki a82b46dad6 Memory leak: Better handling when calling functions 2008-11-21 18:02:20 +00:00
Daniel Marjamäki 7f4cc495df unsigned division and char variable usage - moved checks to "--style" 2008-11-21 08:20:21 +00:00
Reijo Tomperi 51e9d98a5f Refactoring: Errors are no longer logged via global functions to a global stream. Instead callback function is used via interface.
ErrorLogger interface was added and taken into use.
2008-11-20 22:19:26 +00:00
Reijo Tomperi 180e3b99e6 Refactoring: Some global functions moved to Tokenizer class 2008-11-20 20:54:52 +00:00
Daniel Marjamäki dd5abf2c05 cleanup 2008-11-20 19:23:05 +00:00
Daniel Marjamäki 63bc26d662 Function list: Remove functions with duplicate names to prevent false positives 2008-11-20 19:18:55 +00:00
Daniel Marjamäki 2e445b195c Memory leak: Minor update to make the checking stronger 2008-11-19 18:57:35 +00:00
Daniel Marjamäki 7a048cf35e Memory leak: Readded some checks that were removed in r481 2008-11-19 18:46:28 +00:00
Daniel Marjamäki 452ada698e Memory leak: Moved false positive to "--all" upon some special case conditions (bug 2313129) 2008-11-19 17:46:09 +00:00
Daniel Marjamäki a8e1cd8920 Buffer overrun: Fixed a segmentation fault 2008-11-18 19:59:50 +00:00
Daniel Marjamäki 8f3c688020 Memory leak: limit the max call depth to 2 2008-11-18 19:44:27 +00:00
Daniel Marjamäki d6075a2125 Memory leak: Minor fix to prevent hang 2008-11-17 20:29:50 +00:00
Daniel Marjamäki 745d885808 minor update to startup message 2008-11-17 18:58:06 +00:00
Daniel Marjamäki 1cd9496039 preprocessor: Better warning when illegal character found 2008-11-17 18:42:58 +00:00
Daniel Marjamäki 2018c25d20 Memory leak: moved simplifyTokens rule to '--all' 2008-11-17 17:31:07 +00:00
Daniel Marjamäki 7e8b3c86f6 Memory leak: Better handling of 'if (0 != p)' 2008-11-17 17:02:06 +00:00
Daniel Marjamäki 2dd4dba90e Array index overrun: Improved the checking of class variables 2008-11-16 18:21:46 +00:00
Daniel Marjamäki 15b5d0abc7 testmemleak: Removed old TODO 2008-11-16 17:29:52 +00:00
Reijo Tomperi eb1b0abc1e Refactoring: tokens() changed to const and to return const pointer. 2008-11-16 16:13:38 +00:00
Reijo Tomperi aa579911ab Refactoring: Global variable tokenes is no more. 2008-11-16 15:58:52 +00:00
Reijo Tomperi 231e753289 Refactoring: static variable in CheckMemoryLeak is now a private member of the class. 2008-11-16 15:39:42 +00:00
Reijo Tomperi ce08224547 Few static variables are now private members. ShowAll etc. global variables are now members of Settings class and given as a
parameter to the classes that need them.
2008-11-16 15:18:50 +00:00
Daniel Marjamäki 2ecb805283 Memory leak: Mismatching allocation and deallocation in subfunction 2008-11-16 13:55:16 +00:00
Daniel Marjamäki 8dab130d3e Memory leak: Added a simple test case 2008-11-16 07:33:28 +00:00
Daniel Marjamäki d5d2f0671c Memory leak: reverted most of change 461. 2008-11-16 06:34:22 +00:00
Daniel Marjamäki d11e93f475 Memory leak: Added test case that failed. And fixed it. 2008-11-16 05:57:41 +00:00
Reijo Tomperi 0a638a57d0 Bug fix: Missing include from previous commit, didn't compile on Debian. 2008-11-15 22:54:39 +00:00
Reijo Tomperi 08b25dc0d4 Refactoring: Global/Static variables, FunctionList, GlobalFunctions and UsedGlobalFunctions are now private members of Tokenizer class.
Class GlobalFunction is now private subclass of Tokenizer. 
Global functions CheckGlobalFunctionUsage, FillFunctionList and GetFunctionTokenByName are now member functions of Tokenizer.
2008-11-15 22:41:56 +00:00
Daniel Marjamäki 2cbfa6b60b Memory Leak: Handling Linux lists better => Detect more leaks 2008-11-15 18:24:40 +00:00
Daniel Marjamäki 43dcf6efd6 codeblocks: Added project file 'testrunner.cbp' 2008-11-15 18:03:59 +00:00
Daniel Marjamäki adad786d75 SimplifyTokens: Replace 'sizeof(*abc)' with '100'. This prevents false positives in checks 2008-11-15 17:21:35 +00:00
Daniel Marjamäki 1801f25bce Simplify Tokens: Replace NULL with 0 and '(char *)0' with '0' 2008-11-15 16:27:09 +00:00
Daniel Marjamäki 8c9c6529b8 Uninitialized Member Variables: Fixed bug 'false positive on multi constructors' 2008-11-15 15:22:10 +00:00
Daniel Marjamäki add2283724 cleanup files 2008-11-15 13:05:58 +00:00
Daniel Marjamäki 9034c8b27e Uninitialized member variable: Added unit test that currently fails for bug 2270353 - Uninitialized variable false positive on multi constructors 2008-11-15 08:53:51 +00:00
Daniel Marjamäki 607036d4eb Visual C++ Express 2008: Added project 'testrunner' and updated the project 'cppcheck' 2008-11-15 07:15:01 +00:00
Daniel Marjamäki 9454bee161 Borland C++: Added files "cppcheck" and "settings" to the projects 2008-11-15 07:01:07 +00:00
Daniel Marjamäki da52dfe948 Applied patch "errors_only_man" that adds description for "--errorsonly" to the man page. This was submitted by kimmov in bug 2277848 2008-11-15 06:44:32 +00:00
Reijo Tomperi 403017de99 Refactoring: New classes CppCheck and Settings. Code from main.cpp was moved to cppcheck.cpp 2008-11-14 22:26:38 +00:00
Reijo Tomperi 1efb4c95a6 Refactoring: Global variable Files is no more. Use tokenizer->getFiles() to get a pointer to it. 2008-11-13 22:39:47 +00:00
Reijo Tomperi 1c9bf8cabd Make: New improved makefile 2008-11-13 20:48:25 +00:00
Daniel Marjamäki 4995c5d4c6 Uninitialized variable: chained assignments 2008-11-13 18:16:36 +00:00