Commit Graph

1160 Commits

Author SHA1 Message Date
Daniel Marjamäki 65f7bcbfa5 null pointers: fixed TODO assertion - dereference pointer in function call and then checking that it is not NULL 2010-08-05 08:19:36 +02:00
Daniel Marjamäki 6f228033d2 null pointers: fixed todo test case 2010-08-05 08:06:19 +02:00
Daniel Marjamäki 9d24c9ceaa Memory leaks: refactoring return handling 2010-08-04 23:01:32 +02:00
Daniel Marjamäki 239d264432 uninitialized variables: fixed false negatives when uninitialized pointer data is read 2010-08-04 21:13:40 +02:00
Daniel Marjamäki 6d94c4f15e Memory leaks: don't translate 'return p[10];' to 'return use ;' 2010-08-04 20:48:20 +02:00
Daniel Marjamäki 33bf8bf730 Fixed #1670 (False negative: Array index out of bounds in return statement) 2010-08-04 20:38:52 +02:00
Daniel Marjamäki c9b1804954 astyle formatting 2010-08-04 20:28:41 +02:00
Daniel Marjamäki 08e2d91372 Fixed #1919 (option '--suppressions file' can not work when filename includes colon) 2010-08-03 17:52:03 +02:00
Daniel Marjamäki 9edecd4a3f Added ErrorLogger::reportProgress and removed ErrorLogger::ReportProgress. This will make it easier for GUI and other clients to display progress information. 2010-08-03 16:36:21 +02:00
Daniel Marjamäki 6700351ede Fixed #1833 (memory leak detected in version 1.37 not detected in 1.43) 2010-08-02 23:04:23 +02:00
Daniel Marjamäki ff9d3d0965 memory leaks: better handling of 'loop { dealloc ; alloc ; }' 2010-08-02 22:17:09 +02:00
Daniel Marjamäki ae0252dc91 memory leaks: simplify 'callfunc ; ;' 2010-08-02 21:59:47 +02:00
Daniel Marjamäki df44703ee9 memory leaks: better checking of function calls. If there are statements after the function call it is unlikely the function call is noreturn 2010-08-02 21:56:50 +02:00
Kimmo Varis 2fa4378338 Astyle cleanup with new Astyle options. 2010-07-31 15:44:08 +03:00
Daniel Marjamäki a274cb1015 cleanup headers 2010-07-31 08:52:28 +02:00
Daniel Marjamäki 694325d51f Fixed #1912 (False positive: memory leak (calling noreturn function)) 2010-07-30 08:50:10 +02:00
Daniel Marjamäki 2e2baa23a6 Fixed #1909 (### Internal error in Cppcheck. Please report it) 2010-07-28 21:03:15 +02:00
Ettl Martin 9fa6b20b9d checkheaders: removed redundant include (token.h) from errorlogger.cpp 2010-07-27 21:40:38 +02:00
Daniel Marjamäki 81d7a37b68 Fixed #1864 (Relative Path of #include-File doesn't work) 2010-07-27 18:07:30 +02:00
Daniel Marjamäki 2fd2ab1712 Fixed a vs compiler warning. Ticket: #1901 2010-07-27 17:48:22 +02:00
Kimmo Varis 45a6742e3f Windows: Add _CRT_SECURE_NO_WARNINGS define.
The _CRT_SECURE_NO_WARNINGS define suppresses some Windows-specific
compile warnings. Windows has "secure" versions of some functions
and compiler outputs warnings that those "secure" versions should
be used instead. Since other platforms don't have those functions
we just suppress this warning for now on.
2010-07-27 17:34:13 +03:00
Daniel Marjamäki 94acebc3d0 Cleanup redundant include 2010-07-27 09:32:20 +02:00
Zachary Blair 9f44d9eb62 Fixed #1889 (false positive: Common realloc mistake) 2010-07-26 23:17:27 -07:00
Daniel Marjamäki 7c5219324e Refactoring: Cleanup include that checkheaders reported as not needed 2010-07-26 22:05:51 +02:00
Kimmo Varis 17395b310d Remove unneeded path separator conversion. 2010-07-26 22:49:47 +03:00
Kimmo Varis 2f8d43984f Fix path separators for couple of messages. 2010-07-26 22:43:49 +03:00
Kimmo Varis 7b8cb17a44 Windows: convert to internal separators when finding files. 2010-07-26 22:16:19 +03:00
Kimmo Varis 60cf37d1ef Update VS 2010 project files. 2010-07-26 22:06:33 +03:00
Robert Reif 0bb07e6947 Create a symbol database 2010-07-26 16:46:37 +02:00
Daniel Marjamäki bb7484945a Fixed #1887 (internal error in GLee) 2010-07-25 18:20:30 +02:00
Daniel Marjamäki e358af9018 Refactoring: Report progress when checking takes a long time. Ticket: #1868 2010-07-25 18:19:37 +02:00
Daniel Marjamäki 786ca037ec Refactoring: changed 'bool varid=0' to 'bool varid=false' 2010-07-25 18:17:44 +02:00
Daniel Marjamäki 29b2be19ab Fixed #1383 (Preprocessor: define - ifndef problem) 2010-07-25 15:19:25 +02:00
Daniel Marjamäki 0c65796984 Refactoring: Cleanup headers using checkheaders 2010-07-24 22:12:56 +02:00
Daniel Marjamäki 19e26c3b80 CheckBufferOverrun: report progress. Ticket: #1868 2010-07-24 20:54:42 +02:00
Daniel Marjamäki b8146271a2 Report progress when checking a file takes a long time. Ticket: #1868 2010-07-24 18:58:52 +02:00
Daniel Marjamäki 05c4138b2f Refactoring: Removed unused variable _xmllist 2010-07-24 18:57:38 +02:00
Daniel Marjamäki 9c17114668 Fixed #1893 (false positive: dereferencing null pointer (try/catch)) 2010-07-24 14:27:18 +02:00
Daniel Marjamäki dfbdd8f9c4 Refactoring Token::Match: Report errors through ErrorLogger. Ticket: #1839 2010-07-24 10:51:17 +02:00
Daniel Marjamäki 9b49202da8 Refactoring Tokenizer::syntaxError 2010-07-24 10:39:01 +02:00
Daniel Marjamäki dd07d82c34 Refactoring MathLib: Report errors through the tokenizer. Ticket: #1839 2010-07-24 10:25:03 +02:00
Daniel Marjamäki 84e576de04 Refactoring: use MathLib add/sub instead of calculate 2010-07-24 10:13:45 +02:00
Daniel Marjamäki 3ad8f98c61 Refactoring: Settings::addSuppression return error message and callers make sure it's reported properly. Ticket: #1839 2010-07-23 23:12:56 +02:00
Daniel Marjamäki 5c771adece Refactoring: Use Check::reportError instead of writing to std::cout. Ticket: #1839 2010-07-23 22:53:29 +02:00
Daniel Marjamäki 8a0d989190 Refactoring: Don't throw exceptions in the tokenizer upon errors. Ticket: #1866 2010-07-23 14:02:29 +02:00
Daniel Marjamäki 5e0a4a173a Refactoring: The preprocessor will report errors instead of throwing exceptions. Ticket: #1866 2010-07-23 13:54:52 +02:00
Daniel Marjamäki 37c959023a Refactoring: The Settings::addEnabled will return error message instead of throwing it. Ticket: #1866 2010-07-23 13:29:16 +02:00
Daniel Marjamäki 1b7796791b Variable scope: Improved verbose information (see also 7ef0296) 2010-07-23 12:29:21 +02:00
Daniel Marjamäki e1612bc175 Fixed #1891 (Internal error when enum assigned to sizeof without brackets) 2010-07-22 22:21:12 +02:00
Daniel Marjamäki f69109fbf6 Fixed #1828 (### Internal error in Cppcheck. Please report it.) 2010-07-22 19:57:48 +02:00
Kimmo Varis b4d55d8e65 Fix path separators for missing include files-message. 2010-07-21 17:00:12 +03:00
Kimmo Varis 9b0851ed25 Fixed #1892 (Verbosity setting set to false and not set back to original value)
Verbosity was set to false to temporarily reduce printing messages.
But it was not set back to its original value so rest of the
messages that should have been printed for verbose setting
enabled were not printed.
2010-07-21 16:26:59 +03:00
Kimmo Varis 618076a65f Better fix for #1371.
Now handles also system includes. And have couple of tests.
2010-07-21 14:16:42 +03:00
Kimmo Varis 9d29ee6edd Use enum for header file types 2010-07-21 12:58:30 +03:00
Robert Reif f2f5b3ebf0 Fixed #1883 (false positive: (style) The function 'A::SetPos' can be const) 2010-07-20 09:43:27 +02:00
Kimmo Varis c25930581c Formatting and improving comments. 2010-07-19 20:06:42 +03:00
Daniel Marjamäki 3c376047ba pulled changes from kimmov (filelocation-refactor) 2010-07-19 18:06:49 +02:00
Zachary Blair df1c911d84 Merge branch 'master' of github.com:danmar/cppcheck 2010-07-19 07:49:44 -07:00
Kimmo Varis 342632a618 Remove './' from begin of paths when printing progress. 2010-07-19 15:05:44 +03:00
Kimmo Varis dc77bc69a0 Move path simplifying code to Path class. 2010-07-19 14:27:05 +03:00
Robert Reif 4cf92992a8 Fixed #1883 (false positive: (style) The function 'A::SetPos' can be const) 2010-07-19 13:16:11 +02:00
Daniel Marjamäki d4d0bc050a Fixed #1865 (Tokenizer::simplifyRedundantParantheses: wrong handling of 'operator delete') 2010-07-19 12:06:20 +02:00
Kimmo Varis 0485976c54 Use std::replace() to replace chars in paths. 2010-07-19 13:02:04 +03:00
Daniel Marjamäki 7ef0296f97 --verbose: added more information for the variableScope error message. 2010-07-19 11:30:01 +02:00
Kimmo Varis c8d866b906 Merge remote branch 'remotes/kimmo/master' 2010-07-19 11:10:04 +03:00
Kimmo Varis 9f78177914 Remove unused methods from ErrorLogger. 2010-07-19 11:04:30 +03:00
Daniel Marjamäki bbf2c6c6e6 Fixed #1880 (false positive: Uninitialized array (initialized in subfunction)) 2010-07-19 10:03:54 +02:00
Kimmo Varis 95fa267c0e Remove misleading comment. 2010-07-19 10:54:53 +03:00
Zachary Blair 9ffd06ff5e Fixed #1856 (false positive: "pData" nulled but not freed upon failure) 2010-07-18 23:55:39 -07:00
Robert Reif 37b37218cf Fixed #1882 (false negative: function can be declared const) 2010-07-19 08:40:46 +02:00
Robert Reif 7842658cb4 Refactoring CheckClass::initializeVarList. Ticket #1811 2010-07-18 20:58:16 +02:00
Daniel Marjamäki e7690836fd fixed the mistake I made when applying patch 2010-07-18 20:56:19 +02:00
Robert Reif 689de10abf uninitialized class members: better handling of nested classes 2010-07-18 20:43:51 +02:00
Kimmo Varis b384aabc52 Fixed #1371 (#include "foo\file.h" -> #include "foo/file.h" should be handled automatically on linux)
Linux can't open file paths with / separator. So we'll need to fix
such include file paths (in source files) first.
2010-07-18 20:02:18 +03:00
Daniel Marjamäki 1fb4758583 Fixed #1855 (false positive: uninitialized variable (function call in switch condition)) 2010-07-18 13:19:37 +02:00
Daniel Marjamäki 020a8a965c use cppcheckError to report Tokenizer/Preprocessor error instead of std::cerr 2010-07-18 12:57:29 +02:00
Daniel Marjamäki a4b887f21a Fixed #1843 (Tokenizer::createTokens() calls std::exit(0)) 2010-07-18 12:44:55 +02:00
Daniel Marjamäki c16b5d6f3a Fixed #1857 (XML tag no more included for unusedFunction error (1.44 regression)) 2010-07-18 11:22:26 +02:00
Kimmo Varis 006c9f17d4 GUI: Avoid unnecessary path separator conversion. 2010-07-18 11:20:10 +03:00
Robert Reif 81a053aa90 Fixed #1311 (false negative: missing const not found in derived classes) 2010-07-18 10:18:41 +02:00
Kimmo Varis 6903f61f69 Update Visual Studio projects. 2010-07-17 17:59:47 +03:00
Kimmo Varis 5d1a10b0a3 Astyle cleanup. 2010-07-17 17:42:17 +03:00
Kimmo Varis 3c12d23fd9 Add Path class for path handling routines.
In this initial commit the Path class contains two methods for
converting path separators. I want to move cppcheck path handling
to direction that we internally have paths with / separator. And
convert from/to native separators when needed.
2010-07-17 17:38:36 +03:00
Robert Reif 9c4bbd4c65 Fixed #1730 (False negative in 'variable not initialized in ctor') 2010-07-17 12:26:05 +02:00
Robert Reif ad9d1375aa Fixed #1875 (CheckClass::getVarList: simplify function use) 2010-07-17 12:25:14 +02:00
Kimmo Varis 6db365e6f7 Improve path name handling in ErrorLogger.
This commit adds setfile() method to FileLocation class. The setfile
method converts in Windows path separators to internally used Unix
separators. And getfile() converts path separators back to Windows
separators. This fixes bugs that error reports had mixed path
separators in paths.
2010-07-17 01:27:40 +03:00
Kimmo Varis 6362e50e73 Fix comment. 2010-07-16 22:47:46 +03:00
Kimmo Varis 3fa4e8a1d5 Remove unused ErrorLogger::_writemsg() methods. 2010-07-16 21:40:02 +03:00
Robert Reif d72365ab00 Fixed #1375 (false negative: uninitialized member variables not found in nested class constructors) 2010-07-15 10:16:16 +02:00
Kimmo Varis ad0394939a Refactor ErrorMessage constructor to take Severity::SeverityType.
This removes lots of unneeded casting as everybody now uses the
Severity::SeverityType.
2010-07-14 23:11:32 +03:00
Kimmo Varis d811970531 Merge remote branch 'remotes/kimmo/severity-refactor' 2010-07-14 22:29:02 +03:00
Kimmo Varis ba5017cf05 Add debug-severity to Severity::SeverityType. 2010-07-14 21:12:54 +03:00
Kimmo Varis f54f28530b Make Severity::none to match and output empty string. 2010-07-14 21:12:54 +03:00
Kimmo Varis 5f8af2e1e8 Refactor ErrorMessage's severity to Severity::SeverityType. 2010-07-14 21:12:39 +03:00
Robert Reif fd352865ca CheckClass: Improvements and refactorings for constructors and variables checking 2010-07-14 19:00:52 +02:00
Daniel Marjamäki a6b6022497 Fixed #1851 (false positive: Member variable not initialized int ctor) 2010-07-14 18:50:29 +02:00
Kimmo Varis fa0f6edacf Rename ErrorMessage::toText() to ErrorMessage::toString(). 2010-07-14 18:31:05 +03:00
Kimmo Varis 05adb285c5 Rename Severity::stringify() to Severity::toString(). 2010-07-14 17:40:18 +03:00
Kimmo Varis 3716b3f9d8 Rename Severity::e to Severity::SeverityType. 2010-07-14 17:30:03 +03:00
Daniel Marjamäki bea714445a Fixed #1850 (An access to a nested std::map via a negative integer key is reported as 'Array index out of bounds') 2010-07-14 12:24:07 +02:00