Commit Graph

600 Commits

Author SHA1 Message Date
Daniel Marjamäki 6f8e42a5af changed the astyle formatting flags 2011-10-13 20:53:06 +02:00
Kimmo Varis 3cfe7ca1a7 Move "information" errors to "style" errors.
"information" severity is documented in lib/errorlogger.h as:

  Checking information.
  Information message about the checking (process) itself. These
  messages inform about header files not found etc issues that are
  not errors in the code but something user needs to know.

It IS NOT for errors in the code. All the current "information"-
severity errors fit nicely into description of the "style"-
severity.

We definitely need to separate processing information and actual
errors in the code. It is highly confusing for users to mix these
two different things. Hence all current "information" code error
messages are moved to "style" category.

Ticket: #3165 (Stop misusing the 'information' error severity!)
2011-10-05 20:44:00 +03:00
Robert Reif 272783347b another variation of false negative from #3149 2011-09-30 16:26:08 -04:00
Robert Reif 1dcb8b2382 really fix #3149 (false negative: Technically the member function 'A::f' can be const.) 2011-09-30 11:16:34 -04:00
Robert Reif 556d523e4f fix #3149 (false negative: Technically the member function 'A::f' can be const.) 2011-09-29 20:16:52 -04:00
Robert Reif 540207533b fix #3008 (New check: Order of initialisation list) 2011-09-27 21:07:37 -04:00
Robert Reif 1717bda382 fix wrong information about constness of function 2011-09-16 18:07:25 -04:00
Robert Reif 2bc7da2c64 quick fix for #3114 (infinite recursion when operator= is overloaded) 2011-09-14 19:04:06 -04:00
Edoardo Prezioso 1ff7410f4f Fixed #3075 (False positive => Improve tokenizer: remove redundant code after a 'return' state) 2011-09-13 07:55:47 +02:00
Robert Reif 2d952c65e4 fix #3051 (False positive: operator= should return reference (when function takes pointer argument)) 2011-08-28 11:14:15 -04:00
Robert Reif 9a0d076295 fix #3052 (False Positive - Technically the member function 'Example::Clear' can be const.) 2011-08-28 09:21:00 -04:00
Robert Reif 1d7ab77251 fix #3043 (False Positive - Member variable 'ProgramRecPriorityInfo::profile' is not assigned a value in 'ProgramRecPriorityInfo::operator=') 2011-08-25 23:27:10 -04:00
Robert Reif dfe89f395a fix #3049 (False Positive - Technically the member function 'VideoOutputNull::SetupDeinterlace' can be const.) 2011-08-25 19:13:53 -04:00
Robert Reif c7cb38b0b5 fix #3040 (False positive - Technically the member function 'PSIPTable::SetSection' can be const.) 2011-08-22 20:34:00 -04:00
Kimmo Varis cfcfa3f000 Use "enabled" list for the style checking.
Settings-class currently enables style checking via dedicated
boolean attribute. All other CLI's enable-options are handled
through the enable-list. This commit moves style-check enabling
to use the enable-list.

Main advantage is the consistency how options are handled/stored
in the Settings class. Which also unifies using them for the other
code. You need to enable certain type of checks? Use the
addEnabled()-method. You want to check if certain type of checks
are enabled? Use the isEnabled()-method.
2011-08-07 10:28:52 +03:00
Robert Reif ac6d67dc4d add support for using global qualified :: memset on class and class member initialization 2011-08-04 20:37:27 -04:00
Robert Reif c6a804d306 add std::*.empty() to possible const functions in CheckClass::checkConstFunc 2011-07-30 09:44:20 -04:00
Robert Reif 74c1bdde77 fix #1593 (false negative: the function can be declared as const) 2011-07-30 08:48:11 -04:00
Robert Reif ca2e8b057b fix #2947 (False positive: member variable is not initialized (a[x::y] = 0;)) 2011-07-27 12:03:44 -04:00
Robert Reif 54141f2e7f fix #2943 (Symbol database: Wrong parsing of std::vector as base class.) 2011-07-27 11:23:22 -04:00
Robert Reif 77859b9a0f fix #2878 (derived global class not tokenized properly (class A : ::B { };)) 2011-06-30 07:25:36 -04:00
Robert Reif 443dd4c392 partial fix for #2867 handle derived class 2011-06-29 19:39:19 -04:00
Robert Reif f403de7bad partial fix for #2867 Tokenizer::removeRedundantAssignment didn't understand function local class and removed class variable 2011-06-28 19:48:28 -04:00
Robert Reif 0f6da27b9f fix #2795 (hash operator[] is not 'const') (original patch by Sebastien Debrard) (modified to use the symbol database) 2011-06-03 22:00:27 -04:00
Robert Reif 42316f3e0b fix #2792 (false positive: Member variable 'class::m_val' is not assigned a value in 'class::operator=') 2011-05-24 20:25:34 -04:00
Robert Reif bd03768415 move symbol database tests to testsymboldatabase.cpp 2011-04-28 21:03:57 -04:00
Robert Reif 6abf29bd22 fix spelling of initialized in checkclass messages 2011-04-26 20:37:16 -04:00
Greg Hewgill 3fc1db51d1 Change symbol database such that the typestart token skips over type modifiers (const/static/mutable).
This fixes checking for the case of a memset() on a static variable.
2011-04-23 01:13:23 +12:00
Daniel Marjamäki 061eab4d22 Virtual destructors: Enabled the check again. I think it is conclusive now. Ticket: #2728 2011-04-20 18:03:16 +02:00
Daniel Marjamäki e5d43d4ed2 Renamed Settings::stupid to Settings::experimental 2011-04-10 15:55:08 +02:00
Daniel Marjamäki 30ee9ba6e4 Added Settings::stupid flag that can be used to hide checking that generates false positives. 2011-04-10 13:23:45 +02:00
Robert Reif 3c8644fcf8 added tests for #2710 (False negative on uninitialized member variable in a ctor.) 2011-04-08 07:39:30 -04:00
Robert Reif cf65a73c47 fix CheckClass::operatorEq to check return type more closely (to match check description) 2011-03-31 19:40:28 -04:00
Robert Reif 1e1434e191 make member variable change detection simpler and more accurate for CheckClass::checkConst 2011-03-27 13:59:12 -04:00
Robert Reif 168db82fd6 better checking of assignment to array element in CheckClass::checkConstFunc 2011-03-25 23:02:13 -04:00
Robert Reif f8e1735b0f add support to CheckClass::checkConstFunc for ++/-- array elements 2011-03-25 22:37:32 -04:00
Robert Reif 6e6c86365f add some missing ; at end of class and struct definitions in checkclass tests 2011-03-25 07:58:51 -04:00
Robert Reif 61e720c82b fix #1288 (Use of memset on struct - nested structs not handled) 2011-03-23 21:58:58 -04:00
Robert Reif 7e3e5d628d better fix for #2672 (False positive: function can be const, nested classes declared in one line) 2011-03-23 20:19:32 -04:00
Robert Reif ac7f1f874e add some more CheckClass::noMemset tests 2011-03-22 22:45:19 -04:00
Robert Reif d36ed9aff1 fix #2670 (False positive: function can be const, overloaded functions) 2011-03-22 19:23:36 -04:00
Robert Reif 2277cb6965 fix #2663 (False negative: function can be const (changing unknown or uninitialised variable)) 2011-03-20 13:29:52 -04:00
Robert Reif 41d80b5c8d fix #2664 (False negative: function can be const (using type from another namespace)) 2011-03-20 12:53:37 -04:00
Robert Reif 1de35c168d fix #2657 (segmentation fault of cppcheck ( gcc-testsuite: return f(){} )) 2011-03-17 20:10:56 -04:00
Robert Reif 7e04ea0859 fix removal of throw() from const functions 2011-03-16 19:54:52 -04:00
Robert Reif 47531dd99c fix #2637 (segmentation fault of cppcheck ( {} const const )) 2011-03-15 22:33:14 -04:00
Greg Hewgill fa868e44ae Support use of 'this->' when checking operator=() return type 2011-03-15 20:19:30 +13:00
Robert Reif 27f4b8b88b Convert CheckClass::noMemset to use the symbol database to lookup types. This adds better support for namespaces and nested classes. 2011-03-12 22:41:21 -05:00
Greg Hewgill 1ec6a642dc Revert "Check for memset on nested structs (ticket #1288)"
Turns out this fix is incomplete.

This reverts commit a084697410.
2011-03-10 20:19:31 +13:00
Greg Hewgill a084697410 Check for memset on nested structs (ticket #1288) 2011-03-09 23:02:49 +13:00
Greg Hewgill 3883afcbf4 Check for memset on objects with virtual functions (ticket #607) 2011-03-09 22:10:39 +13:00
Greg Hewgill 70b4076111 refactor noMemset so it recursively checks parent classes for non-memset-compatible things 2011-03-09 21:29:30 +13:00
Robert Reif f596a6959e code cleanup and add more tests to CheckClass::noMemset() 2011-02-24 19:59:50 -05:00
Chuck Larson db7ce1c13c memset: using memset on struct/class that has std::string member variable. ticket: #1655 2011-02-24 18:38:45 +01:00
Robert Reif 5f84272a52 fix segfault: #2591 (cppcheck hangs with 100% cpu load ( class A : )) 2011-02-21 14:25:35 -05:00
Robert Reif 5984b6b53f fix #2595 (False positive Technically the member function 'A::foo' can be const) 2011-02-20 20:01:54 -05:00
Robert Reif fef1142997 fix #2592 (False positive: 'operator=' should return reference to self) 2011-02-19 20:02:16 -05:00
Robert Reif e6eb160395 fix [B#2589 (segmentation fault of cppcheck (struct B : A)) 2011-02-19 14:38:00 -05:00
Daniel Marjamäki 53aaf22633 CheckClass::noMemset: Added TODO test case 2011-02-16 21:31:35 +01:00
Robert Reif 2aefa5deb5 fix #2577 (segmentation fault of cppcheck) 2011-02-12 15:35:48 -05:00
Daniel Marjamäki 26f017e9c6 scripts: added tabs.pl - in my opinion it is bad to use tabs inside string constants. spaces or \t should be used instead. 2011-02-05 12:53:28 +01:00
Robert Reif c592ccd35d Fixed #2547 (segmentation fault of cppcheck) 2011-02-05 08:59:59 +01:00
Robert Reif f87056fca3 Fixed #2539 (segmentation fault of cppcheck) 2011-02-04 20:19:49 +01:00
Robert Reif 8288c28b3f Fixed #2537 (segmentation fault of cppcheck) 2011-02-03 07:57:10 +01:00
Pete Johns 098f0bf3e6 Fixed #2526 (Make TODO_ASSERT_EQUALS take three arguments (value, to_be, as_is)?...
Removed replaced EXPECTED with...

WANTED (to-be):     The future expected value.
CURRENT (as-is):    Documenting how cppcheck behaves now.

This removes the need for an ASSERT_EQUALS but enforces the check for every TODO_ASSERT_EQUALS.
2011-01-30 23:20:11 +11:00
Daniel Marjamäki 524498e439 Tokenizer: collapse operator function names into a single token. ticket: #2519 2011-01-27 18:44:20 +01:00
Robert Reif 767e01e24a Fixed #2478 (Crash when trying to analyze files (CheckClass::checkReturnPtrThis)) 2011-01-21 19:54:41 +01:00
Pete Johns 38c37ad2d8 Moved array declaration detection into isVariableDeclaration() 2011-01-17 08:36:52 +11:00
Robert Reif 0f6644e1ea Symbol database: Refactorings 2011-01-16 11:18:12 +01:00
Robert Reif 79b9939610 Fixed #2465 (False positive: not initialised variable, but there is default constructor for it.) 2011-01-15 07:59:37 +01:00
Reijo Tomperi 226b605774 Change year 2010 -> 2011 in license texts. 2011-01-09 21:33:36 +02:00
Robert Reif 5f078da7ad Fixed #2425 (segmentation fault of cppcheck) 2011-01-07 18:58:14 +01:00
Robert Reif 03a484554c Fixed #2415 (false positive: Member variable not initialized in constructor calling assignment operator) 2011-01-06 07:56:34 +01:00
Daniel Marjamäki 033e759c39 command line: added 'information' id to enable 2011-01-05 21:20:21 +01:00
Markus Elfring e459ed1de3 Fixed #2389 (mistakable warning from 'CheckClass::uninitVarError') 2011-01-03 19:03:42 +01:00
Daniel Marjamäki 3c238882a2 Fixed TODO testcase. Use symbol database instead of token list. Ticket: #2375 2011-01-01 17:54:37 +01:00
Pete Johns 502cfe7243 Fixed #2384 ("The function 's::f' can be const" reported for pointer-to-pointer)
Moved check for pointer variables into isVariableDeclaration()

Can now handle multiple scopes and multiple levels of indirection. Simplified check for strucs and unions, too, reducing the size of getVarList().

skipScopeIdentifiers() and skipPointers() should probably be methods on class Token.
2010-12-31 22:12:32 +11:00
Pete Johns 5d0ace3a50 Fixed #2377 (Technically the member function xxx can be const)
TODO: Add unit test for getVarList() and refactor variable check.

[Removed my testcase for #2377 and removed two TODOs.]
2010-12-30 17:56:28 +11:00
Ettl Martin ac42c0ba3b const correctness: added further testcases for increment/decrement member functions 2010-12-30 02:05:44 +01:00
Ettl Martin 7b92378c3a ticket 2377: added further testcases 2010-12-30 01:44:46 +01:00
Ettl Martin c29824fc49 added todo testcase for ticket 2377 Technically the member function xxx can be const 2010-12-30 01:29:09 +01:00
Robert Reif 3f1f50e970 simplifyTypedef: operator typedef. Ticket: #2375 2010-12-29 20:22:06 +01:00
Daniel Marjamäki 3853f93b34 TestClass: addon for 12f28507, fix a few more error messages. 2010-12-27 08:22:21 +01:00
Kimmo Varis 12f2850777 Improve the message about const function.
See discussion thread:
https://sourceforge.net/apps/phpbb/cppcheck/viewtopic.php?f=3&t=192
2010-12-26 23:44:03 +02:00
Daniel Marjamäki be46d453c4 Information: Added new severity 2010-12-22 19:53:17 +01:00
vBm 46a11183a5 Fixed some spelling mistakes 2010-12-15 18:45:53 +01:00
Robert Reif 980a90071c Fixed #2282 (Improve check: Function can be const) 2010-12-07 19:42:30 +01:00
Robert Reif c20b8831ee Fixed #2275 (False Positive: Member variable not initialized in the constructor) 2010-12-04 20:24:13 +01:00
Robert Reif 04b811b74f Fixed #2273 (False Positive: Member variable not initialized in the constructor) 2010-12-04 17:47:00 +01:00
Robert Reif 2cd8bc74cc Symbol database: The symbol database has a bug where it can find an out of line constructor when looking for a destructor. Ticket: #2272 2010-12-03 07:35:06 +01:00
Robert Reif 1bc8a2b6ba Fixed #2172 (False positive: struct is not initialized in constructor) 2010-12-02 07:35:01 +01:00
Robert Reif f12c0c7ada Tokenizer: add assert(_settings) to Tokenizer to insure the tokenizer always has settings. Ticket: #2219 2010-12-01 18:00:55 +01:00
Robert Reif 43dcc51752 Fixed #2252 (segmentation fault with enable=all) 2010-11-30 19:52:42 +01:00
Robert Reif f90236a183 Fixed #2252 (segmentation fault with enable=all) 2010-11-30 19:40:32 +01:00
Kimmo Varis 87b69a10fa Ticket #2240 (Improve no constructor-message).
Improve the message about missing constructor but having class
attributes. Have proper short and long messages.
2010-11-27 10:17:03 +02:00
Robert Reif 03b12c5494 Fixed #2230 (segmentation fault of cppcheck) 2010-11-25 07:43:39 +01:00
Robert Reif 08b86e0b7e Fixed #2228 (False positive: Claims function can be const when it can not be (shared_ptr)) 2010-11-25 07:15:33 +01:00
Robert Reif f1eef49fcb Fixed #2221 (segmentation fault of cppcheck) 2010-11-23 07:31:15 +01:00
Robert Reif 36b03bdd3e Fixed #2179 (Segmentation fault in assignment operator) 2010-11-09 06:58:19 +01:00
Daniel Marjamäki c2bf3647a4 Fixed #2178 (segmentation fault of cppcheck) 2010-11-08 19:47:19 +01:00
Robert Reif 662cd27f87 Symbol database: fixed problem 2010-11-06 20:27:12 +01:00
Robert Reif 003f99da82 Symbol database: Fixed bug. Ticket: #2149 2010-11-04 06:58:37 +01:00
Robert Reif cf0403434d Symbol database: Bug fix 2010-11-03 20:33:07 +01:00
Robert Reif 0fe72839d8 Symbol Database: Better handling of namespaces. Ticket: #2149 2010-11-02 18:30:57 +01:00
Daniel Marjamäki fee20bafa0 Java: Removed bailout added in 120073f000 2010-10-28 18:01:51 +02:00
Robert Reif b6aca47e11 Fixed #1195 (Uninitialized member variable not detected 'std::vector<int> *ints;') 2010-10-27 19:28:15 +02:00
Robert Reif 5a8f490f07 Fixed #2135 (False positive 'Can be const') 2010-10-27 19:25:34 +02:00
Daniel Marjamäki cf86e11d05 Fixed #2111 (Class methods writing to a union are detected as 'can be const') 2010-10-24 16:43:10 +02:00
Daniel Marjamäki 120073f000 Java: fixed false positives about uninitialized variable 2010-10-23 10:56:30 +02:00
Daniel Marjamäki 92a1e9e76e Severities: Added 'warning' and 'performance' severities. No changes to the command line options nor to the XML format. Ticket: #2106 2010-10-17 14:41:00 +02:00
Robert Reif a58094e827 Fixed #2089 (False negative: Function can be const (calling const function)) 2010-10-13 07:26:41 +02:00
Robert Reif 907ed0ac6f Fixed #2085 (False negative: function can be const when member variable is compared) 2010-10-12 07:57:09 +02:00
Daniel Marjamäki 14f12e0647 Fixed #2078 (false negative: member variable not intialized) 2010-10-10 07:57:26 +02:00
Daniel Marjamäki a7cf68b9ef Check Class: Removed the 'operator= should not return a const reference' 2010-09-18 20:05:34 +02:00
Robert Reif 0153dccb66 Symbol database: Skip bail out in constructors if a virtual function might be called because that would be undefined behaviour. Ticket: #1895 2010-09-14 07:16:53 +02:00
Robert Reif 6de1711515 Symbol database: reduce false negatives for 'uninitialized variable' when calling base class function. ticket: #1895 2010-09-12 22:40:51 +02:00
Robert Reif 69afc0a0db Symbol database: fixed false positive. ticket: #1895 2010-09-11 08:23:30 +02:00
Robert Reif c3762903a9 Symbol database: fixed false negative for uninitialized variable. ticket: #1895 2010-09-09 07:21:51 +02:00
Robert Reif b5276ce9e5 Symbol database: Added todo testcase for better namespace handling. Ticket: #1895 2010-09-03 06:17:34 +02:00
Daniel Marjamäki eb74bfc15a Fixed #2007 (False positive: member variable not initialized (Borland C++ property)) 2010-09-01 18:10:12 +02:00
Robert Reif 4153b7d24b refactoring namespace handling. ticket: #2001 2010-09-01 16:47:53 +02:00
Robert Reif 7a8190e188 Fixed #2002 (Wrong operator() parsing) 2010-09-01 06:32:46 +02:00
Robert Reif e39dda4eed const functions: Added unit test for ticket #2003 2010-09-01 06:18:09 +02:00
Robert Reif 5aab602709 Fixed #2001 (No 'The function ... can be const' warnings when base class is in namespace.) 2010-08-31 17:57:42 +02:00
Robert Reif c56911ba6a Fixed #2000 (segmentation fault of cppcheck with bitfield) 2010-08-31 17:51:10 +02:00
Robert Reif 96d73c189c Symbol database: better handling of operator functions. Ticket: #1895 2010-08-30 17:14:20 +02:00
Robert Reif a862e982ff Fixed #1993 (False negatives: uninitialised variables in constructor) 2010-08-29 16:36:10 +02:00
Robert Reif 7b2b844b8e Fixed #1964 (False positive: function can be const (get this)) 2010-08-20 19:47:41 +02:00
Robert Reif 66de0d8f72 Fixed #1954 (False positive: function can be const (derived class)) 2010-08-20 07:28:31 +02:00
Daniel Marjamäki cfa7b4906e Symbol database: bug fixes. Ticket: #1895 2010-08-18 22:42:04 +02:00
Robert Reif cc079462dd Symbol database: fixed problems with namespaces. Ticket: #1895 2010-08-16 18:55:39 +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 7c18ece65d Symbol database: Fixed bug when end of namespace wasn't found. Ticket: #1895 2010-08-14 08:16:53 +02:00
Robert Reif db78c3acdf Symbol database: fixed linenr problem in virtual destructors check 2010-08-13 23:57:53 +02:00
Robert Reif ab7bb876f9 Symbol database: Refactoring virtual destructors check. Ticket: #1895 2010-08-13 18:34:02 +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 988b43d419 const function check: Added more unit tests 2010-08-10 07:48:09 +02:00
Robert Reif 0b41d822cb Virtual destructors: extended and fixed the testing 2010-08-09 21:22:46 +02:00
Robert Reif bf1352c573 Fixed typo in testcase. Ticket: #1311 2010-08-09 17:57:07 +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 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 050011d287 Fixed #1881 (false positive: The function '...' can be const (nonconst code is hidden inside #if)) 2010-08-07 13:08:36 +02:00
Robert Reif 0bb07e6947 Create a symbol database 2010-07-26 16:46:37 +02:00
Robert Reif f2f5b3ebf0 Fixed #1883 (false positive: (style) The function 'A::SetPos' can be const) 2010-07-20 09:43:27 +02:00
Robert Reif 4cf92992a8 Fixed #1883 (false positive: (style) The function 'A::SetPos' can be const) 2010-07-19 13:16:11 +02:00
Robert Reif 37b37218cf Fixed #1882 (false negative: function can be declared const) 2010-07-19 08:40:46 +02:00
Robert Reif 81a053aa90 Fixed #1311 (false negative: missing const not found in derived classes) 2010-07-18 10:18:41 +02:00
Robert Reif 9c4bbd4c65 Fixed #1730 (False negative in 'variable not initialized in ctor') 2010-07-17 12:26:05 +02: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
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
Robert Reif ab088bcec9 Fixed #1847 (False positive: Method using std::swap<>() can be declared const) 2010-07-13 08:04:48 +02:00
Daniel Marjamäki 76133e0234 Class checking: Fixed FP for static arrays (not initialized in constructor) 2010-06-29 12:51:18 +02:00
Robert Reif f3538dd574 Unit Testing: Added TODO test case for uninitialized member variable in operator=. Ticket: #1813 2010-06-25 07:56:40 +02:00
Daniel Marjamäki 9fd89d3bdc Fixed #1495 (False -s positive: Member variable not assigned a value in operator=) 2010-06-24 20:09:26 +02:00
Daniel Marjamäki 5de124280a Fixed #1783 (false positive: uninitalized variable in constructor/operator=, when calling overloaded functions) 2010-06-13 10:23:59 +02:00
Martin Ettl 2b557cee45 added a TODO testcase for ticket 1724 2010-06-06 12:46:08 +02:00
Daniel Marjamäki 68ad8219ed Fixed #1722 (Member variable initialized in call to base class constructor) 2010-06-06 08:29:35 +02:00
Martin Ettl f75ca79849 applied patch from php-coder from ticket 1724; removed TODO_TESTCASES; 2010-06-05 19:49:49 +02:00
Martin Ettl 90a3d29d70 run astyle 2010-06-03 18:23:16 +02:00
Martin Ettl 156a29815f removed a wrong const declaration 2010-06-03 12:55:56 +02:00
Martin Ettl 7b52284177 added a testcase and todo testcases for ticket #1724 2010-06-03 12:51:42 +02:00
Daniel Marjamäki 82f030df2c the virtual destructor error message needs to be restricted. marked the checking as inconclusive for now. 2010-05-29 11:19:28 +02:00
Robert Reif 4306082fcf Fixed #1708 (False positive for const) 2010-05-25 06:55:49 +02:00
Daniel Marjamäki c5b946f9b7 Unit Testing: Added a few more test cases related to ticket #1700 2010-05-23 21:03:14 +02:00
Daniel Marjamäki bf8ef94f0c Unit Testing: Added test case for ticket 1700 2010-05-23 20:56:51 +02:00
Robert Reif 78614b8dc1 Fixed #1699 (False positive: The function '...' can be const) 2010-05-20 17:45:10 +02:00
Robert Reif 5dfbb38dc9 #1697 (false positive: The function can be const) 2010-05-20 06:52:59 +02:00
Erik Lax 20289b1f5b Fixed #1683 (false positive: The function can be const) 2010-05-16 20:26:32 +02:00
Daniel Marjamäki 6edb2e77b4 Refactoring: Removed Severity::possibleStyle 2010-05-16 14:43:42 +02:00
Daniel Marjamki 8e3c39ae5b Fixed #1678 (false positive: Member variable not initialized in the constructor, for arrays of undefined type) 2010-05-15 20:24:11 +02:00
Daniel Marjamäki 84c3ec9c4c Fixed #1669 (Still seeing 'possible style' warnings in 1.43) 2010-05-10 21:22:59 +02:00
Daniel Marjamäki ae576be088 refactoring: enable the 'suspicious pointer subtraction' checking 2010-05-01 21:43:47 +02:00
Zachary Blair c26e619b23 Fixed #855 (Refactoring: move conditions into checks) 2010-04-20 23:38:25 -07:00
Robert Reif e8ac1f07d9 Unit Testing: Added TODO testcases for ticket #1593 (false negative: the function can be declared as const) 2010-04-19 21:18:53 +02:00
Robert Reif 76a683a73a Fixed #1602 (functions defined in header outside of class cannot be const) 2010-04-18 15:40:31 +02:00
Robert Reif d90f59051c Fixed #1612 (false positive: The function can be const) 2010-04-18 07:53:39 +02:00
Daniel Marjamäki c0e9a546f7 Refactoring: Refactoring the Settings class 2010-04-17 09:23:54 +02:00
Reijo Tomperi 35d2a27b9c Update copyright year in all source files 2010-04-13 22:23:17 +03:00
Daniel Marjamäki e9b4ea44a2 Refactoring: Disable inconclusive checks. They can still be activated for debugging/testing purposes 2010-04-10 14:05:33 +02:00
Daniel Marjamäki d360c01675 Fixed #1579 (False positive: function can be const when return type is unknown) 2010-04-09 19:15:39 +02:00
Daniel Marjamäki 1328a57103 Fixed #1584 (False positive: (static) Member variable not assigned a value in operator=) 2010-04-09 18:35:54 +02:00
Robert Reif b651acfc39 Unit testing: Testing handling of Borland C++ properties 2010-04-07 19:19:28 +02:00
Robert Reif d498095fa1 Unit Testing: Better code coverage of the operator= checking 2010-04-06 18:26:29 +02:00
Daniel Marjamäki 427d155644 Fixed #1527 (Function can't be const if it has non-const operator overload call) 2010-04-02 22:03:07 +02:00
Daniel Marjamäki c6bbc9d739 Fixed #1565 (False positive: Uninitialized variable 'B::j'. There are 2 classes with the name 'B') 2010-04-02 19:29:54 +02:00
Daniel Marjamäki 4225544c82 Added TODO test case to reduce false negatives for uninitialized class members 2010-04-02 19:10:05 +02:00
Robert Reif 3507b06e0b Fixed #1563 (false positive: function can be const (assignment to static)) 2010-04-02 08:02:47 +02:00
Robert Reif 1dcbf02bd8 Fixed #1553 (false positive : uninitialized variable for struct timeval from <sys/time>) 2010-04-02 07:36:18 +02:00
Robert Reif 2825773918 Fixed #1552 (false positive: function can be const (array of struct)) 2010-04-01 17:01:52 +02:00
Robert Reif 2c5fb55c3b Fixed #1551 (false positive: The function 'A::vSet' can be const) 2010-04-01 16:59:35 +02:00
Robert Reif a8c9aa1f8d Fixed #1550 (Improve check: Assignment to self) 2010-04-01 16:40:12 +02:00
Robert Reif 78e54e17f2 Unit testing: Added test case for memset. Ticket: #1538 2010-03-31 19:53:53 +02:00
Robert Reif 7fb5b9b67b Better checking for assignment to self. Ticket: #1550 2010-03-31 17:09:59 +02:00
Daniel Marjamäki c213227133 Fixed #1535 (False positive: member variable not initialized, struct with constructor) 2010-03-29 20:34:47 +02:00
Robert Reif 62d2845014 Fixed #1492 (false negatives: array index out of bounds) 2010-03-28 15:56:13 +02:00
Robert Reif 2dc4222c9a Refactoring: Added CheckClass::isMemberFunc 2010-03-28 11:46:42 +02:00
Daniel Marjamäki 16124ce646 Fixed #1516 (C++Builder properties mistaken for uninitialized variables) 2010-03-28 10:58:03 +02:00
Reijo Tomperi a18c964efa astyle fix 2010-03-27 21:41:17 +02:00
Martin Ettl e4bda66b28 extended The function can be const test 2010-03-27 14:11:46 +01:00
Robert Reif 2eceaaefc0 Fixed #1519 (false negative: the function can be declared as const) 2010-03-26 20:14:31 +01:00
Robert Reif 45865f54a8 Fixed #1525 (false negative: the function can be declared as const (member declared as mutable)) 2010-03-26 19:06:00 +01:00
Robert Reif 307000b448 Fixed #1529 (false positive: function can be const (struct member variable)) 2010-03-26 18:16:33 +01:00
Daniel Marjamäki 258e7e292e Fixed #1496 (false positive: Member variable not initialized in the constructor 'X::m_d') 2010-03-26 17:19:33 +01:00
Robert Reif a1528d3154 Fixed #1522 (false positive: function can be const (assignment in return)) 2010-03-26 16:30:30 +01:00
Robert Reif e95bc41e59 Fixed #1522 (false positive: function can be const (assignment in return)) 2010-03-24 19:31:30 +01:00
Robert Reif 9808a59cc1 Fixed #1515 (false positive: The function 'wxThreadInternal::SetExitCode' can be const) 2010-03-23 07:37:20 +01:00
Robert Reif 637a34bfd2 Fixed #1517 (false negative: the function can be declared as const) 2010-03-23 07:34:34 +01:00
Robert Reif 0fb680d887 Tokenizer: remove unnamed anonymous structures and unions (#1493) 2010-03-19 19:04:56 +01:00
Robert Reif 92fe14e7f0 Fixed #1491 (False positive when putting an access specifier at the end of a class declaration) 2010-03-19 17:40:23 +01:00
Robert Reif 89c57c72c5 small const fix 2010-03-16 07:31:40 +01:00
Daniel Marjamäki 9fe9be1ea9 Fixed #1465 (false positive: unintialized class member) 2010-03-13 20:24:39 +01:00
Robert Reif 846a3a0186 Fixed #1491 (False positive when putting an access specifier at the end of a class declaration) 2010-03-13 08:06:20 +01:00
Robert Reif f552ca5462 Fixed #1482 (Improve check const-function: function can be made const when assignment not to member variable (false negative)) 2010-03-12 18:30:20 +01:00
Robert Reif 09ab841789 Fixed #1486 (--errorlist shows two identical id values) 2010-03-10 07:47:01 +01:00
Daniel Marjamäki dbc235bd39 Function constness: I don't think it's necessary to show both definition and implementation location. I changed so only the location of the definition is shown. This fixes #1486. 2010-03-09 07:29:03 +01:00
Robert Reif 7c283d1321 Fixed #1321 (Improve check const-function: function that is not implemented inline can be made const) 2010-03-05 17:06:25 +01:00
Robert Reif 0da133f8a0 Fixed #1451 (false positive: operator = should return reference to self) 2010-02-25 07:26:59 +01:00
Daniel Marjamäki 8f4edb5e45 Fixed #1409 (False positive: Buffer access out-of-bounds with strncpy and an array in typedef'ed struct) 2010-02-21 15:23:50 +01:00
Daniel Marjamäki d5611a1a06 Fixed #1426 (false positive: returning LPVOID can be const) 2010-02-21 10:19:28 +01:00
Daniel Marjamäki d0348fa57a Fixed #1403 (false positive: The function can be const) 2010-02-20 09:55:51 +01:00
Robert Reif 9e61e7dda8 Fixed #1405 (false positive: operator = should return reference t 2010-02-17 22:46:03 +01:00
Daniel Marjamäki 0a6aa0f094 Fixed #1376 (Member variable not initialized in the constructor false positive) 2010-02-10 19:28:51 +01:00
Robert Reif 9591e09dd0 Fixed #1344 (false negative: missing const not found) 2010-02-08 07:25:19 +01:00
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 f561441d90 Fixed #1319 (false negative: missing const not found) 2010-01-29 19:38:56 +01:00
Robert Reif 94c5d92b2b Fixed #1323 (segfault with style in CheckClass::operatorEqRetRefThis()) 2010-01-29 16:04:27 +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
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 b4b97e5706 const: fixed false positive when using increment/decrement 2010-01-24 13:33:30 +01:00
Daniel Marjamäki a0d8f44603 CheckClass: The operator< etc member functions can often be const 2010-01-23 22:36:04 +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 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 59de7934b7 Fixed #643 (Member variable not initialized not detected if any unknown function called) 2010-01-22 18:51:25 +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
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 485f3c7708 Fixed #1221 ([False positive] Member variable not initialized with operator[] gives wrong result) 2010-01-06 19:04:15 +01:00
Robert Reif e6cc897e29 Fixed #1224 (segmentation fault of cppcheck) 2010-01-05 21:55:33 +01:00
Robert Reif 2a546dc9c0 Fixed #1184 (improve test: operator =) 2010-01-03 08:26:02 +01:00
Daniel Marjamäki 774e331dea Self assignment in class: added TODO test cases to reduce false positives 2009-12-31 14:03:35 +01:00
Robert Reif 12641e2d76 Fixed #1184 (improve test: operator =) 2009-12-31 13:44:03 +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 905533552d Robert Reif: Fixed #1164 (only first void operator = found) 2009-12-29 07:48:37 +01:00
Daniel Marjamäki e7c0e4d482 Fixed #1093 (False positive: missing constructor) 2009-12-19 17:58:52 +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 4d185f0935 Fixed #1080 (false positive: member variable not initialized) 2009-12-11 21:34:04 +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 39614a699e Uninitialized variables: detect uninitialized pointer array 2009-11-10 19:35:54 +01:00
Daniel Marjamäki c301dc1907 Fixed #928 (false positive: member variable not initialized in constructor) 2009-11-10 19:30:37 +01:00
Reijo Tomperi 9a55f4ca43 Add one more test case for #895 (false positive: Suspicious pointer subtraction) 2009-11-04 21:38:40 +02:00
Reijo Tomperi 80c66f8ebc Fix #895 (false positive: Suspicious pointer subtraction)
http://sourceforge.net/apps/trac/cppcheck/ticket/895
2009-11-04 21:36:27 +02:00
Daniel Marjamäki 319cdc2b43 Fixed #880 (Tokenizer: The Tokenizer::simplifyTemplates doesn't handle recursive templates) 2009-11-01 19:03:52 +01:00
Daniel Marjamäki 09859c1019 refactoring the folder structure 2009-10-25 12:49:06 +01:00
Reijo Tomperi 1b1047a5e4 Fix #757 (Change message: (style) The class 'KClass' has no constructor)
http://sourceforge.net/apps/trac/cppcheck/ticket/757
2009-09-29 21:27:17 +03:00
Reijo Tomperi fdde2182b9 Fix GPL comments in all files. ">." was missing from the end. 2009-09-27 18:08:31 +03:00
Daniel Marjamäki c5368581d9 Fixed by #675 (false positive: when operator is overloaded) 2009-09-16 20:07:03 +02:00
Daniel Marjamäki f4b6c822d3 Fixed #375 (new check: Detect when using 'this-x') 2009-09-12 15:25:02 +02:00
Reijo Tomperi 7408674017 Fix #601 (Poor var initialization assumption when can't find function definition)
http://sourceforge.net/apps/trac/cppcheck/ticket/601
Fix #641 ((style) Member variable not initialized in the constructor: False Positive)
http://sourceforge.net/apps/trac/cppcheck/ticket/641

This fix will also cause us not to detect several potential issues, but as there are so many
false positives, any unknown function call should stop the error for now. New
ticket is created to handle regression caused by this:
http://sourceforge.net/apps/trac/cppcheck/ticket/643
2009-09-03 23:28:00 +03:00
Reijo Tomperi 686ff425f9 Fix ticket #637 (False positive, Using 'memset' on struct that contains a 'std::string')
http://sourceforge.net/apps/trac/cppcheck/ticket/637
2009-09-02 23:51:07 +03:00
Reijo Tomperi 7569bda227 Added few memset test cases 2009-09-02 23:32:15 +03:00
Daniel Marjamäki 03d7573208 Borland C++: Don't warn about uninitialized variables that are declared in the __published section. These are auto-initialized 2009-08-31 19:40:49 +02:00
Reijo Tomperi 929dbe92e4 Fix the last test case from ticket #613 (array members variables are not checked in constructor)
http://sourceforge.net/apps/trac/cppcheck/ticket/613
2009-08-26 23:33:23 +03:00
Reijo Tomperi d778f67265 Fix sytax error in uninitVarArray(). This also causes the test to fail, so changing it as TODO.
See http://sourceforge.net/apps/trac/cppcheck/ticket/613
2009-08-26 00:42:07 +03:00
Daniel Marjamäki 0c479b8c9f TestClass: Added a testcase where a array member variable is initialized through strcpy 2009-08-24 17:15:29 +02:00
Reijo Tomperi c581753040 Fix ticket #613 (array members variables are not checked in constructor)
http://sourceforge.net/apps/trac/cppcheck/ticket/613
Patch from micres
2009-08-23 22:54:41 +03:00
Reijo Tomperi 93604dd344 Fixed ticket #578 (missing virtual destructor not detected)
http://sourceforge.net/apps/trac/cppcheck/ticket/578
2009-08-10 17:58:13 +03:00
Daniel Marjamäki 3331cb834f Hoangtuansu: Fixed #537 (false positive::operator= should return something) 2009-08-09 19:57:48 +02:00
Reijo Tomperi 975e7778ab Fix ticket #531 (false positive about missing virtual destructor)
http://sourceforge.net/apps/trac/cppcheck/ticket/531
2009-08-04 22:23:22 +03:00
Slava Semushin 5dea30519c Fixed ticket #459 (false positive::Member variable not initialized in constructor)
http://sourceforge.net/apps/trac/cppcheck/ticket/459
2009-07-17 23:50:49 +07:00
Reijo Tomperi b2474fd980 Fix ticket #452 (Failure to detect "member var not initialized in constructor" if class inherits)
http://sourceforge.net/apps/trac/cppcheck/ticket/452
2009-07-03 21:22:14 +03:00
Slava Semushin 52a8368b02 Strip redundant std::string usage from tests.
Second round: handle empty strings.

Done by command:
git grep -l ASSERT_EQUALS | xargs sed -i 's|ASSERT_EQUALS(std::string(\(".*"\)),|ASSERT_EQUALS(\1,|'

Should be no functional change.
2009-06-05 07:43:55 +07:00
Slava Semushin 6745d9b8ef Fixed ticket #358 (Local typedef flagged as uninitialized member)
http://apps.sourceforge.net/trac/cppcheck/ticket/358
2009-06-05 07:34:12 +07:00
Slava Semushin e5c0383594 Strip redundant std::string usage from tests.
Done by command:
git grep -l ASSERT_EQUALS | xargs sed -i 's|ASSERT_EQUALS(std::string(\(".\+"\)),|ASSERT_EQUALS(\1,|'

Should be no functional change.
2009-06-01 02:50:25 +07:00
Reijo Tomperi 58eda6e978 Fix ticket #325 (Replace developer names in source files with AUTHORS file)
http://apps.sourceforge.net/trac/cppcheck/ticket/325
2009-05-30 08:48:12 +03:00
Reijo Tomperi a12fd4ff5e Fix ticket #282 (protected destructor - false positive)
http://apps.sourceforge.net/trac/cppcheck/ticket/282
2009-05-06 23:22:26 +03:00
Daniel Marjamäki 7afccc395a testing: new handling of todo test cases. If they use TODO_ASSERT_EQUALS instead we can detect when they are fixed 2009-03-25 18:31:40 +01:00
Daniel Marjamäki 5914af4481 refactoring CheckClass 2009-03-20 17:30:24 +01:00
Reijo Tomperi fc8f47145a Copyrights updated 2009-03-01 19:52:33 +00:00
Daniel Marjamäki d8927e720d constructors: don't warn about missing constructor if class only has static variable members 2009-02-21 13:35:55 +00:00
Daniel Marjamäki a9009ebf7d TestClass: Added test for uninitialized "mutable int i" 2009-02-21 08:24:57 +00:00
Reijo Tomperi d1e9efc66a Fix ticket #104 (Change (error) Uninitialized member variable -> (style) Member variable not initialized in the constructor) 2009-02-14 08:52:03 +00:00
Daniel Marjamäki 574db37a6f uninitialized variables: added testcases and made a fix 2009-02-09 07:47:41 +00:00
Reijo Tomperi b211b8cbe8 Fix ticket #84 (unit testing: use "protected" instead of preprocessor) 2009-02-07 20:06:00 +00:00
Reijo Tomperi a06861948b Fixed: Ticket #78 Change (always) into (error) in error messages 2009-02-05 21:06:32 +00:00
Daniel Marjamäki 9707217c15 activated TestClass:function 2009-02-04 19:42:40 +00:00
Daniel Marjamäki 8187504cbb testclass: added todo testcase for #74 2009-02-04 19:31:25 +00:00
Daniel Marjamäki 3457b38d7a errmsg: write severity in the message 2009-01-31 08:33:31 +00:00
Daniel Marjamäki 8cd2979468 uninitialized member: don't check private constructors 2009-01-27 17:39:06 +00:00
Reijo Tomperi 176dd41306 Fixed Ticket #40, Check copyright texts in files, now that we have new developers. 2009-01-21 20:04:20 +00:00
Reijo Tomperi 58b398a4a8 Fix Ticket #32 False positive with --style: Uninitialized member variable (when stream is used) 2009-01-17 20:17:57 +00:00
Reijo Tomperi f6452e3613 Test case for Ticket #32 2009-01-17 19:26:58 +00:00
Daniel Marjamäki 03cfe18c9b errmsg: Added 'condition is always true/false' 2009-01-14 19:43:28 +00:00
Daniel Marjamäki 22583269c1 Uninitialized member variables: Checking enum variables 2009-01-14 19:34:10 +00:00
Reijo Tomperi e435a1f1d6 Refactoring: Added src/ and test/ folders. Moved source files to those folders, updated makefile and codeblocks project file. 2009-01-06 14:18:36 +00:00