Commit Graph

254 Commits

Author SHA1 Message Date
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 ca50bc7850 move 2 CheckClass helper functions to follow externally called functions so code matches comments 2011-03-25 22:21:40 -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 14c07e988e fix pointer/reference check in CheckClass::noMemset symbol database conversion 2011-03-22 22:29:39 -04:00
Robert Reif 5314cc02b2 convert remainder of CheckClass::noMemset to use symbol database 2011-03-22 22:23:57 -04:00
Robert Reif 468a983db1 use the symbol database to look up base classes in CheckClass::noMemset check 2011-03-22 21:24:28 -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
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
Robert Reif 79f0fe7d1c refactor symbol database and checks to use list of Scope rather than list of Scope pointers 2011-03-10 19:43:29 -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 31a18b9b23 convert CheckClass::noMemset to use new variable lookup capability 2011-02-26 16:00:05 -05: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 ba6c2ca310 fix #2602 (segmentation fault of cppcheck ( class A {A& operator=(const A&); }; )) 2011-02-22 06:47:28 -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 537ac0cb34 use func->start rather than searching for '{' in CheckClass::privateFunctions 2011-02-20 08:36:06 -05:00
Robert Reif 7dd8a3283a fix comment in CheckClass::initializeVarList 2011-02-19 20:09:07 -05:00
Robert Reif fef1142997 fix #2592 (False positive: 'operator=' should return reference to self) 2011-02-19 20:02:16 -05:00
Daniel Marjamäki 227a6100f7 astyle formatting 2011-02-11 19:31:37 +01:00
Robert Reif b8c5426bb8 fix #2567 Unused private function when implemented in different file 2011-02-11 08:00:41 -05:00
Raphael Geissert f8e2d50e6f Use Token::simpleMatch where no special patterns are needed 2011-02-02 13:27:02 -06:00
Raphael Geissert 8d5863133c Use Token::simpleMatch where no patterns are used 2011-02-02 13:27:01 -06:00
Raphael Geissert cf2b6f7bc1 Remove useless spacing at the end of *Match strings 2011-02-02 13:27:01 -06:00
Greg Hewgill be195a72c9 initialise Check::_name in constructor rather than relying on virtual Check::name() 2011-02-02 22:58:25 +13:00
Daniel Marjamäki 524498e439 Tokenizer: collapse operator function names into a single token. ticket: #2519 2011-01-27 18:44:20 +01:00
Daniel Marjamäki 1e25d74ba4 Class: better check if there are friends. ticket: #2459 2011-01-22 17:35:54 +01:00
Daniel Marjamäki 9551332321 Fixed #2459 (False positive with unused private function and friend) 2011-01-22 13:00:03 +01:00
Robert Reif 767e01e24a Fixed #2478 (Crash when trying to analyze files (CheckClass::checkReturnPtrThis)) 2011-01-21 19:54:41 +01:00
Robert Reif d73709a620 Symbol database: rename variables. ticket: #2468 2011-01-21 07:42:41 +01:00
Pete Johns 94aafa482c Fixed #2480 (false positive on unused private function) 2011-01-19 20:32:08 +11:00
Pete Johns ea01c04108 Added parenths to fix build breakage. 2011-01-18 21:07:33 +11:00
Robert Reif 8631ee65a3 Fixed #2474 (false positive: Member variable 'A::m_SemVar' is not initialised in the constructor.) 2011-01-18 07:34:11 +01:00
Robert Reif c994508c3e Symbol database: Refactor the variables API. ticket: #2468 2011-01-18 07:32:06 +01:00
Robert Reif 959e10cee5 Symbol database: renamed classes. ticket: #2468 2011-01-17 18:29:19 +01:00
Robert Reif bf9528558e Symbol database: pulled out classes into global scope. ticket: #2468 2011-01-17 07:21:59 +01:00
Robert Reif d341b42b0c Symbol database: increased constness. ticket: #2468 2011-01-16 18:13:54 +01:00
Robert Reif 66be74a5af Symbol database: Refactorings. Move check-specific code to check. Ticket: #2468 2011-01-16 16:37:11 +01:00
Daniel Marjamäki a97e28491f Fixed #2407 (False positive: unused private function) 2011-01-16 12:16:31 +01:00
Robert Reif 0f6644e1ea Symbol database: Refactorings 2011-01-16 11:18:12 +01:00
Reijo Tomperi 226b605774 Change year 2010 -> 2011 in license texts. 2011-01-09 21:33:36 +02: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
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