Commit Graph

492 Commits

Author SHA1 Message Date
Dmitry-Me 14f13afa0a Don't care which type protected operator= returns 2014-12-26 15:38:22 +01:00
Dmitry-Me 5e37275b2a Code cleanup. Use 'isDelete' instead of token match 2014-11-28 17:50:23 +01:00
Dmitry-Me f926958acb Fix false positive about return type when there's =delete in operator= declaration 2014-11-25 15:52:52 +01:00
Robert Reif d12f14844a Fixed #6279 (False Positive: Member variable 'Fred::i' is not initialized in the constructor) 2014-11-20 06:18:29 +01:00
Robert Reif 67385cfc4b Symboldatabase: improved look up of delegate constructors 2014-11-13 06:29:51 +01:00
PKEuS e5d63195cb Fixed #5983: Support storing pointers/references to member variables in CheckClass::checkConst() 2014-11-02 13:38:03 +01:00
PKEuS 38af865560 Fixed false positive: Member variable not initialized in the constructor with array and (*this) (#5754) 2014-09-29 16:49:20 +02:00
PKEuS 03b1afc28c Loops over all varIds should start at 1. 2014-09-28 09:47:11 +02:00
PKEuS e8f7279039 Refactorization: Moved detection of STL strings to SymbolDatabase 2014-09-05 12:03:08 +02:00
PKEuS a8dc17c1d9 Fixed false positive #5566. 2014-08-26 11:29:26 +02:00
PKEuS f01d7543f6 #6077: Don't warn about memcpy/memmove on class containing floats. 2014-08-20 15:12:53 +02:00
PKEuS 8188578cf2 SymbolDatabase: Fixed handling of nested types for function arguments
Removed unnecessary loops between var->typeStartToken() and var->typeEndToken()
2014-08-19 11:55:00 +02:00
PKEuS 5d302716e7 Refactorized Variable::isIntegralType() and Variable::isFloatType():
- Cached property
- Make use of it in several checks
- float* is flagged as floating point type
2014-08-09 11:45:13 +02:00
PKEuS 728d0fb9dc Merge pull request #390 from Dmitry-Me/suppressGccShadowingWarning
Avoid GCC name shadowing warning.
2014-08-09 10:34:36 +02:00
PKEuS c4635cf698 Improved check: portability message when calling memset on a class with floating point numbers (#5421) 2014-08-08 09:49:09 +02:00
PKEuS e4b55cf843 Fixed a bug and two warnings introduced recently. 2014-08-06 13:35:39 +02:00
Dmitry-Me 3ec821df34 Avoid GCC name shadowing warning. 2014-08-06 15:35:04 +04:00
PKEuS 8130fda4ae Implemented support for C++11 uniform initialization in several checks. 2014-08-05 16:11:42 +02:00
PKEuS 4207b3cb66 Fixed error message. 2014-08-05 11:59:53 +02:00
PKEuS 804e055eee New check: initialization by itself in initializer list (#3982)
Refactorizations:
- Rearranged code in checkclass.cpp to increase readability
- Several fixes for testclass.cpp tests.
2014-08-05 11:50:08 +02:00
Dmitry-Me a4d597451b Resolve CID 1214637. 2014-07-24 16:54:20 +04:00
Dmitry-Me 615eb32fdc Use temp variables to avoid repeated actions in code. 2014-07-23 18:51:23 +04:00
Dmitry-Me fae9d975cf Use boolean flag to avoid comparison duplication 2014-07-18 13:31:31 +04:00
Daniel Marjamäki cb9d67b9ec Fixed #5901 (False positive: (error) Using 'memcpy' with vector of uint8_t items) 2014-07-09 15:00:06 +02:00
Dmitry-Me 7da6ce8704 Omit unnecessary checks 2014-07-08 12:28:57 +04:00
amai2012 9b38ae73c1 Attempt to fix 2 Coverity messages.
Replace a few unsigned int by std::size_t
2014-07-07 21:25:30 +02:00
Robert Reif 1f09cb0c30 Fixed #5807 (non virtual dtor in virtual class) 2014-06-14 12:55:20 +02:00
Dmitry-Me 6e1568a6db Simplify code - bail out early, vreak loops early, reorder checks and declarations. 2014-06-09 13:35:30 +04:00
Alexander Mai b139ae3209 #5782 Endless recursion in CheckClass::checkReturnPtrThis(). Break endless recursion by remembering the callstack 2014-05-11 12:26:24 +02:00
Daniel Marjamäki f31ec37d52 Fixed 2 Cppcheck warnings. Function can be static|const 2014-05-10 11:49:14 +02:00
Alexander Mai 623e5db0b2 #5702 crash: clang: test/Parser/cxx0x-member-initializers.cpp (bailout withn an internal error) 2014-04-21 21:44:17 +02:00
Mark de Wever 6f3e3f5e2e Fixed #5701 (FP for std::unordered_map::operator[]; there is no const version) 2014-04-21 16:39:44 +02:00
PKEuS 076f7a7542 Fixed some coverity findings about dead code, fixed a misleading comment 2014-04-14 22:46:51 +02:00
Philipp Kloke dfd9d32c4b Refactorization: Removed whitespaces at the end of a token
Removed a redundant 'void'
2014-04-12 23:41:46 +02:00
PKEuS b10fce304e Don't suggestInitializationList for arrays used as initializer (#5640) 2014-04-10 22:28:02 +02:00
Alexander Mai 173a2e9ea2 #5641 fix crash within CheckClass::initializeVarList() 2014-04-04 22:13:51 +02:00
Daniel Marjamäki 640431c569 Fixed #5611 (segfault when checking pcsc-cyberjack. either symboldatabase or checkMemset) 2014-03-30 17:38:07 +02:00
Alexander Mai 70885c78e4 Fix endless recursion within CheckClass::isConstMemberFunc() caused by incomplete/missing template declaration 2014-03-30 10:09:57 +02:00
Alexander Mai bf335217cd Fix #5605 part 2 - now endless recursion within CheckClass::isMemberFunc() 2014-03-30 08:31:02 +02:00
Alexander Mai d1b1699bb0 Fix #5606 - Endless recursion in CheckClass::isMemberVar(). New function Type::hasCircularDependencies() is supposed to detect loops within the class hierarchy which was causing the problem 2014-03-29 12:21:35 +01:00
Alexander Mai 34d1f885a3 Ticket #4296: Improve message text for operatorEq 2014-03-28 20:29:33 +01:00
Daniel Marjamäki 2a0716449f Fixed #5498 (C++0x11 default values for class fields and missing constructor) 2014-03-24 06:15:51 +01:00
PKEuS 77c17100ec Bailout in private function usage checking for operators (#5059). 2014-03-23 10:06:14 +01:00
PKEuS b6b374cf3d Added verbose message for "memsetClass" error. (#5183) 2014-03-17 13:23:23 +01:00
PKEuS 1e57f54917 Fixed #5481: std::array is POD, so using memcpy (etc.) is allowed on it. 2014-03-16 19:55:32 +01:00
Alexander Mai 40ddcabab6 Fixed #4461 (Warn about memset/memcpy on class with references as members) 2014-03-15 18:22:29 +01:00
Thomas Jarosch 93341f4449 Use simple match where possible
Fixes these warnings found by "--enable=internal":

[lib/checkclass.cpp:972]: (warning) Found simple pattern inside Token::Match() call: "* *"
[lib/checkbufferoverrun.cpp:635]: (warning) Found simple pattern inside Token::Match() call: "."
[lib/checkbufferoverrun.cpp:1397]: (warning) Found simple pattern inside Token::Match() call: ";"
[lib/checksizeof.cpp:299]: (warning) Found simple pattern inside Token::Match() call: "."
[lib/checksizeof.cpp:301]: (warning) Found simple pattern inside Token::Match() call: ")"
[lib/checksizeof.cpp:303]: (warning) Found simple pattern inside Token::Match() call: "]"
[lib/checksizeof.cpp:318]: (warning) Found simple pattern inside Token::Match() call: ")"
[lib/checknullpointer.cpp:413]: (warning) Found simple pattern inside Token::Match() call: "delete"
[lib/checkio.cpp:1336]: (warning) Found simple pattern inside Token::Match() call: "> ("
[lib/checkstl.cpp:1509]: (warning) Found simple pattern inside Token::findmatch() call: ";"
[lib/checkstl.cpp:1512]: (warning) Found simple pattern inside Token::findmatch() call: ";"
[lib/checkstl.cpp:1594]: (warning) Found simple pattern inside Token::Match() call: "="
[lib/checkstl.cpp:1598]: (warning) Found simple pattern inside Token::Match() call: "] ="
[lib/checkunusedvar.cpp:755]: (warning) Found simple pattern inside Token::Match() call: "goto"
[lib/checkunusedvar.cpp:793]: (warning) Found simple pattern inside Token::Match() call: "="
[lib/checkuninitvar.cpp:376]: (warning) Found simple pattern inside Token::Match() call: "> ("
[lib/checkother.cpp:86]: (warning) Found simple pattern inside Token::Match() call: "> ("
[lib/checkother.cpp:2181]: (warning) Found simple pattern inside Token::Match() call: "> {"
[lib/valueflow.cpp:54]: (warning) Found simple pattern inside Token::Match() call: "&"
[lib/valueflow.cpp:409]: (warning) Found simple pattern inside Token::Match() call: "do"
[lib/valueflow.cpp:425]: (warning) Found simple pattern inside Token::Match() call: ") {"
[lib/valueflow.cpp:487]: (warning) Found simple pattern inside Token::Match() call: ") {"
[lib/valueflow.cpp:511]: (warning) Found simple pattern inside Token::Match() call: "} else {"
[lib/valueflow.cpp:615]: (warning) Found simple pattern inside Token::Match() call: "for ("
[lib/symboldatabase.cpp:80]: (warning) Found simple pattern inside Token::Match() call: "= {"
[lib/symboldatabase.cpp:1069]: (warning) Found simple pattern inside Token::Match() call: "std ::"
[lib/tokenize.cpp:2207]: (warning) Found simple pattern inside Token::Match() call: "< >"
[lib/tokenize.cpp:2730]: (warning) Found simple pattern inside Token::Match() call: ";"
[lib/tokenize.cpp:4234]: (warning) Found simple pattern inside Token::Match() call: "try {"
[lib/tokenize.cpp:4235]: (warning) Found simple pattern inside Token::Match() call: "} catch ("
[lib/tokenize.cpp:5500]: (warning) Found simple pattern inside Token::Match() call: "INT8"
[lib/tokenize.cpp:5752]: (warning) Found simple pattern inside Token::Match() call: "}"
[lib/tokenize.cpp:5752]: (warning) Found simple pattern inside Token::Match() call: "do"
2014-03-14 16:27:47 +01:00
Robert Reif d1eb04c539 Fixed #4302 (Member variable not initialized in public delegate constructor) 2014-03-12 05:48:13 +01:00
Simon Martin 8baf8dbebb Ticket #5425: Avoid infinite recursion in checkMemsetType for invalid input 2014-03-03 07:19:32 +01:00
Lauri Nurmi 70a67eaf85 Change some more 0 literals into nullptr. 2014-02-16 13:38:50 +02:00