Commit Graph

1305 Commits

Author SHA1 Message Date
Daniel Marjamäki e7f7c77eab Fixed #1948 (C++ class scoping not followed) 2010-08-24 22:04:14 +02:00
Daniel Marjamäki ca407110dc Fixed #1936 (Internal error. Token::Match called with varid 0.) 2010-08-24 20:58:22 +02:00
Daniel Marjamäki 225114df1c Fixed #1960 (cppcheck hangs with 100% cpu load) 2010-08-24 20:50:04 +02:00
Robert Reif d961a6ec9e Tokenizer: Fixed cppcheck and compiler warnings 2010-08-24 07:28:56 +02:00
Daniel Marjamäki 39a69b0871 Fixed #1970 (Internal error. CheckClass::SpaceInfo::getVarList found variable '_root' with varid 0.) 2010-08-23 21:22:11 +02:00
Daniel Marjamäki f7063bed7c Fixed #1967 (Tokenizer::setVarid doesn't set variable value (list of function pointers)) 2010-08-23 20:15:02 +02:00
Daniel Marjamäki 3b716dfcc9 Tokenizer: Simplified the bitfields handling. This patch just looks for the bitfield signature but doesn't care about the type. I don't think any other code would have this same signature so it should be OK. We could add code to only look in structures and classes but I don't think that is necessary. Ticket: #1956 2010-08-23 07:29:05 +02:00
Robert Reif 807269b5e9 Refactoring handling of microsoft types. Ticket: #1956 2010-08-22 21:53:45 +02:00
Robert Reif cb7b508f77 Tokenizer::simplifyBitfields: fixed more issues. Ticket #1956 2010-08-22 13:25:47 +02:00
Robert Reif 3fcca23b53 Tokenizer: better handling of bitfields. Ticket: #1956 2010-08-22 09:41:22 +02:00
Robert Reif 77d634127c Tokenizer: simplify DECLARE_DYNAMIC and DECLARE_DYNCREATE 2010-08-22 09:38:05 +02:00
Robert Reif ac9078857e Tokenizer: simplify bitfields. Ticket: #1956 2010-08-21 16:34:41 +02:00
Robert Reif 9c594684db Tokenizer: handle DECLARE_DYNAMIC. Ticket: #1956 2010-08-21 07:55:14 +02:00
Robert Reif 7173e01926 Fixed #1965 (tokenizer::simplifyEnum add support for C++0x enums) 2010-08-21 07:44:56 +02:00
Robert Reif 7b2b844b8e Fixed #1964 (False positive: function can be const (get this)) 2010-08-20 19:47:41 +02:00
Daniel Marjamäki 741ce40e3d Tokenizer::setVarId : fixed problem for class members 2010-08-20 19:28:10 +02:00
Daniel Marjamäki 3dd504bcb2 updates of Visual Studio files 2010-08-20 17:59:09 +02:00
Robert Reif 66de0d8f72 Fixed #1954 (False positive: function can be const (derived class)) 2010-08-20 07:28:31 +02:00
Robert Reif f123e951ec Fixed #1963 (typedef array incorrectly simplified) 2010-08-20 07:11:02 +02:00
Daniel Marjamäki cfa7b4906e Symbol database: bug fixes. Ticket: #1895 2010-08-18 22:42:04 +02:00
Daniel Marjamäki 0934035fcf Fixed #1955 (cppcheck hangs with 100% cpu load) 2010-08-18 22:22:14 +02:00
Daniel Marjamäki 1fd773b245 Fixed #1944 (segfault in Tokenizer::simplifyLogicalOperator) 2010-08-17 20:06:20 +02:00
Daniel Marjamäki aa00587fed #1943 (segmentation fault of cppcheck (= default)) 2010-08-17 19:50:21 +02:00
Daniel Marjamäki 1faaa5471c Fixed #1946 ('Dereferenced iterator erased' false positive) 2010-08-17 18:56:11 +02:00
Robert Reif 86f1718b1c Symbol database: Fixed the error reporting so errors are shown in the gui. Ticket: #1895 2010-08-17 17:20:54 +02:00
Daniel Marjamäki 64cdee62ef Fixed #1942 (false positive: uninitialized variable in __asm__ statement) 2010-08-16 19:38:47 +02:00
Robert Reif cc079462dd Symbol database: fixed problems with namespaces. Ticket: #1895 2010-08-16 18:55:39 +02:00
Daniel Marjamäki 85acb005a2 Fixed #1941 (Internal error::Space Info::getVarList found variable with varid 0) 2010-08-16 18:51:25 +02:00
Sbastien Debrard 296289d190 Refactoring of obsolete functions checks. Ticket: #1940 2010-08-15 21:26:13 +02:00
Daniel Marjamäki 72916caee6 Reverted 7398453cb0 2010-08-15 21:25:14 +02:00
Sbastien Debrard 7398453cb0 Refactoring of obsolete functions checks. Ticket: #1940 2010-08-15 21:22:33 +02:00
Daniel Marjamäki fe482785aa Variable Id: Fixed various bugs related to templates and bitfields. Ticket: #1928 2010-08-15 11:54:28 +02:00
Daniel Marjamäki 4949869f5f removed unused variable 'dot' 2010-08-15 09:03:16 +02:00
Daniel Marjamäki e1d6320a55 quick fix for #1905 (false positive: the function '...' can be declared as const (member array is assigned)) 2010-08-15 08:30:21 +02:00
Robert Reif 556ef9afcf Symbol database: report error when it is detected that a variable id is missing. Ticket: #1928 2010-08-15 08:03:27 +02:00
Erik Lax 54b7f972c9 Fixed #1932 (false positive: unused private function) 2010-08-15 07:44:08 +02:00
Zachary Blair c8087d3389 Fixed #162 (Initialisation of a variable by itself) 2010-08-14 21:34:04 -07:00
Daniel Marjamäki 4ff9a1ac94 Fixed #1928 (missing varId for template class variable) 2010-08-14 20:50:49 +02:00
Erik Lax 248bb3b6e8 Fixed #1935 (false negative: detect buffer overrun from network functions (recv, recvfrom..)) 2010-08-14 20:19:23 +02:00
Sbastien Debrard a55a06cea5 Fixed #1933 (Add checks for obsolete functions) 2010-08-14 20:13:46 +02:00
Daniel Marjamäki 00dc3adc18 ErrorLogger: Added better \n handling to the XML output 2010-08-14 18:36:36 +02:00
Daniel Marjamäki 2e249670b3 dangerous scanf usage: Added verbose information 2010-08-14 18:35:48 +02:00
Daniel Marjamäki 5846630fa9 Added scanf check. Modified patch submitted by Eric Sesterhenn 2010-08-14 15:15:12 +02:00
Robert Reif 7c18ece65d Symbol database: Fixed bug when end of namespace wasn't found. Ticket: #1895 2010-08-14 08:16:53 +02:00
Daniel Marjamäki 6efad92647 dangerous functions: removed 'scanf' because it can be used in a safe way 2010-08-14 07:50:35 +02:00
Robert Reif db78c3acdf Symbol database: fixed linenr problem in virtual destructors check 2010-08-13 23:57:53 +02:00
Daniel Marjamäki e9a3d03372 Dangerous functions: Improved error messages 2010-08-13 22:27:45 +02:00
Erik Lax 032d2678aa Fixed #1930 (false negative: bad iterators checks fails to detect bugs with preincrement) 2010-08-13 20:54:31 +02:00
Robert Reif ab7bb876f9 Symbol database: Refactoring virtual destructors check. Ticket: #1895 2010-08-13 18:34:02 +02:00
Robert Reif a994f235c5 Symbol database: move finding base classes until after all classes are found because of template instantiation. Ticket: #1895 2010-08-13 07:35:30 +02:00
Robert Reif b92644a30c Symbol database: refactoring variable handling. Ticket: #1895 2010-08-13 07:34:34 +02:00
Daniel Marjamäki 6cb7fefdbf Added command line option --report-progress. ticket: #1926 2010-08-12 21:03:33 +02:00
Ettl Martin a6be941006 actived Wconversion flag in Makefile and fixed almost all Warnings from gcc-4.4 2010-08-12 19:39:19 +02:00
Robert Reif 47c776247a Symbol database: fix a small bug and add more tests. ticket: #1895 2010-08-12 07:38:27 +02:00
Robert Reif c88aa242e8 Symbol database: better handling of 'friend'. ticket: #1895 2010-08-11 22:36:04 +02:00
Daniel Marjamäki cb72f21994 Optimisation in Tokenizer::tokenize 2010-08-11 17:29:33 +02:00
Daniel Marjamäki 0ea9e98680 Optimisation: Made inner loop in Tokenizer::setVarId faster 2010-08-10 19:06:45 +02:00
Daniel Marjamäki a1f288d088 Tokenizer::setVarId : Fixed a problem when using static class members 2010-08-10 18:22:58 +02:00
Robert Reif 03c436a735 Symbol database: Refactoring 2010-08-10 18:01:33 +02:00
Robert Reif 483a3ddfe1 Fixed #1925 (fix some cppcheck warnings in cppcheck) 2010-08-10 07:26:59 +02:00
Robert Reif 217b9425b5 Fixed #1922 (False positive: function can be const when both const and non-const functions are provided.) 2010-08-09 17:54:16 +02:00
Robert Reif 12523bc745 Symbol database: Enhancements and fixes. Ticket: #1895 2010-08-09 17:50:26 +02:00
Daniel Marjamäki 6a3befa720 Optimising: Tokenizer::setVarId when setting variable ids for struct/class members 2010-08-08 19:14:23 +02:00
Daniel Marjamäki 195b48e81f astyle formatting 2010-08-08 18:55:15 +02:00
Daniel Marjamäki 1d79c164c4 Optimisation: Optimised firstWordEquals 2010-08-08 18:54:49 +02:00
Daniel Marjamäki 5a8181d425 Tokenizer: 'simplifyCalculations();' should have the same results as 'while (simplifyCalculations());' 2010-08-08 09:25:09 +02:00
Daniel Marjamäki 11ef2c0a06 Refactoring: Cppcheck::reportProgress needs to call _errorLogger::reportProgress. Ticket: #1625 2010-08-08 08:46:47 +02:00
Daniel Marjamäki 1555901077 Refactoring: Made Tokenizer::simplifyCalculations a little faster 2010-08-08 08:28:28 +02:00
Daniel Marjamäki 764ce99c6f Performance: Refactoring CheckOther::nullPointerStructByDeRefAndChec to make it faster 2010-08-07 21:00:17 +02:00
Daniel Marjamäki dcf54621d4 visual studio: fixed a few compiler warnings (when saving istream::get result in a char) 2010-08-07 20:33:24 +02:00
Daniel Marjamäki 029613d4c4 Fixed #1923 (False positive: Possible null pointer derefence in else if) 2010-08-07 19:59:56 +02:00
Daniel Marjamäki 262885f3e0 Fixed #1921 (false positive: the function '...' can be declared as const (inline friend)) 2010-08-07 16:08:44 +02:00
Daniel Marjamäki ed4f1164a1 Fixed #1894 (unreadVariable false positive with const references) 2010-08-07 15:53:51 +02:00
Daniel Marjamäki 050011d287 Fixed #1881 (false positive: The function '...' can be const (nonconst code is hidden inside #if)) 2010-08-07 13:08:36 +02:00
Daniel Marjamäki 54121a74ff Symbol Database: Don't use it when it is not needed 2010-08-07 12:41:11 +02:00
Daniel Marjamäki 9e7b087832 Refactoring: Made CheckClass members private 2010-08-07 12:26:42 +02:00
Daniel Marjamäki c395e51389 New check: look for calculation inside sizeof 2010-08-06 22:57:10 +02:00
Daniel Marjamäki 7911626aed gcc: fixed some more -Wsign-conversion warnings 2010-08-06 22:43:06 +02:00
Daniel Marjamäki 12217461a2 gcc: fixed some more -Wsign-conversion warnings 2010-08-06 22:37:48 +02:00
Daniel Marjamäki adc47f1820 Fixed #1487 (fix gcc compiler warnings) 2010-08-06 21:02:43 +02:00
Daniel Marjamäki 271a74a16c gcc: Fixed some compiler warnings when using -Wsign-conversion. Ticket: #1487 2010-08-06 19:42:31 +02:00
Daniel Marjamäki faa713e7b5 gcc: Fixed some compiler warnings when using -Wsign-conversion. Ticket: #1487 2010-08-06 19:40:54 +02:00
Daniel Marjamäki 290d02780f gcc: Fixed some compiler warnings when using -Wsign-conversion. Ticket: #1487 2010-08-06 19:38:21 +02:00
Daniel Marjamäki 3adfc61eca gcc: Fixed some compiler warnings when using -Wsign-conversion. Ticket: #1487 2010-08-06 19:15:44 +02:00
Daniel Marjamäki 146465a6ad gcc: Fixed some compiler warnings when using -Wsign-conversion. Ticket: #1487 2010-08-06 18:42:55 +02:00
Daniel Marjamäki 7fb44d1995 gcc: fixed some compiler warnings when using -Wsign-conversion 2010-08-06 18:32:31 +02:00
Daniel Marjamäki 6346e1aa90 Borland C++: Fixed compiler errors 2010-08-06 17:44:26 +02:00
Daniel Marjamäki f5823f7747 Visual Studio: Fixed warnings 2010-08-06 17:32:16 +02:00
Daniel Marjamäki 567f1da4b4 Preprocessor: Compiler dependent parsing of '<backspace><space><newline>'. Maybe it should be possible to control it from the commandline instead. Ticket: #640 2010-08-06 08:50:31 +02:00
Daniel Marjamäki 32d98969fb suppress visual studio warnings about loosing data when calculating Token::progressValue 2010-08-05 21:40:04 +02:00
Daniel Marjamäki eedb5e383e Memory leaks: better handling of 'return strcmp(..' etc 2010-08-05 21:23:32 +02:00
Daniel Marjamäki 81c058f2be Merge branch 'master' of github.com:danmar/cppcheck 2010-08-05 19:02:21 +02:00
Daniel Marjamäki 2450a80556 Visual Studio: Added /MP switch 2010-08-05 19:02:05 +02:00
Ettl Martin d16944398a fixed compiler Warning in lib/checkbufferoverrun about comparison of signed and unsigned variable 2010-08-05 18:58:58 +02:00
Daniel Marjamäki 1b2f16f443 Buffer overflow: Fixed two TODO test cases 2010-08-05 11:01:47 +02:00
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