Commit Graph

7470 Commits

Author SHA1 Message Date
Daniel Marjamäki ad0d23036c Fixed some cppcheck warnings about methods that can be static/const 2015-11-14 18:43:07 +01:00
PKEuS bdd57e6913 Revert "Fix multi-threading by converting static member variables to instance variables"
This reverts commit 598809a834.

The problem does not exist in practice and the theoretical issue will be fixed as soon as the check is rewritten to make use of Libraries.
2015-11-14 12:07:00 +01:00
Daniel Marjamäki b10110b5ac CheckClass: Removed noExplicitCopyMoveConstructorError after discussion in http://sourceforge.net/p/cppcheck/discussion/general/thread/b2ce9d3d/. 2015-11-13 12:48:26 +01:00
PKEuS f9bc229d4b Support varids in nested classes that are declared outside of outer class (#7127) 2015-11-13 10:07:57 +01:00
Daniel Marjamäki 595f1e1a27 ValueFlow: set value for char literals 2015-11-12 16:38:58 +01:00
Daniel Marjamäki 34dbc3c00c ValueFlow: Improved handling of a[i] 2015-11-12 16:14:27 +01:00
Daniel Marjamäki 4ec333dbb6 Fixed #7007 (ValueFlow: value is not known, modified by subfunction) 2015-11-12 14:59:35 +01:00
PKEuS 1589841cb6 Fixed crash in clang test suite with member variable pointers 2015-11-11 18:26:59 +01:00
PKEuS 36c5815ddb Fixed false positive about redundant variable assignment in try-scopes if the variable is read in catch block (#6555) 2015-11-11 17:21:55 +01:00
PKEuS a8cf63239a Fixed false positive autovarInvalidDeallocation if deallocting result of member function (#6551) 2015-11-11 16:59:31 +01:00
Daniel Marjamäki b9b0964dab Fixed #7006 (False positive Mismatching assignment and comparison (variable is changed in loop)) 2015-11-11 13:45:28 +01:00
PKEuS ee00925dc5 setVarId: Support throw() in constructor implementations (#7123) 2015-11-11 11:01:49 +01:00
PKEuS 03d52de74b Treat "class" keyword similar to "struct" or "union" on C++ code (#6696) 2015-11-10 17:03:27 +01:00
PKEuS cc9a1f4375 Fixed setVarId() for template in initializer list (#7122) 2015-11-10 16:14:53 +01:00
PKEuS feae241fc0 Fixed simplification of pointers (#6829) 2015-11-10 14:45:24 +01:00
PKEuS 6336372fb4 Apply same heuristics in CheckMemoryLeakNoVar::checkForUnusedReturnValue() as in CheckOther::checkIgnoredReturnValue(): Ensure that a defined function has non-void return value. (#6693) 2015-11-10 14:19:45 +01:00
PKEuS 06780b5eaa Merge pull request #704 from simartin/warn
Silence clang warning.
2015-11-10 13:35:12 +01:00
Daniel Marjamäki 459a4e0cbe Fixed #7121 (False positive 'Uninitialized variable' converting pointer to reference) 2015-11-10 10:18:24 +01:00
Simon Martin 1ec3175c99 Silence clang warning (-Wparentheses mode). 2015-11-10 08:12:36 +01:00
PKEuS 5cd36d6f8a Refactorization: Use varid instead of variable name in CheckClass::initializeVarList() and fixed issue in setVarId().
Fixed internal warning.
2015-11-09 23:00:14 +01:00
PKEuS 49a9b011eb Fixed handling of this-> and (*this). in setVarId() 2015-11-09 21:43:40 +01:00
PKEuS db342ea910 Handle alias variables in CheckClass::initializeVarList() (#6921) 2015-11-09 21:02:06 +01:00
PKEuS aca8a69f5e Skip over lambdas in CheckClass::checkPureVirtualFunctionCall() (#4992) 2015-11-09 20:15:26 +01:00
PKEuS f15f8514f6 Fixed crash on garbage code (#7120) 2015-11-09 17:25:20 +01:00
PKEuS 389d30fe44 Fixed crash on garbage code (#7118) 2015-11-09 11:21:07 +01:00
PKEuS c7987ad11a Refactorization: Removed redundant nullptr checks. The existence of the tokens is guaranteed by previous Token::Match() call 2015-11-09 11:12:32 +01:00
Daniel Marjamäki 5074c11b53 CheckBufferOverrun: Fixed FP when accessing string that contains '\0'. Refactoring address-of. 2015-11-09 10:30:39 +01:00
Daniel Marjamäki 8317369c91 Explicit constructors: don't warn for abstract classes unless C++11 is used. 2015-11-09 08:36:47 +01:00
Daniel Marjamäki ef5be435c7 Fixed #7113 (False positive arrayIndexOutOfBounds - using pointer alias with cast) 2015-11-08 17:21:32 +01:00
Alexander Mai 5318970f1e #7109 segmentation fault (invalid code) in TokenList::createAst 2015-11-08 15:09:39 +01:00
Daniel Marjamäki fc564d779e Fixed #7112 (crash: CheckBufferOverrun::checkGlobalAndLocalVariable (invalid code)) 2015-11-08 14:21:12 +01:00
Daniel Marjamäki 37dbebb093 Fixed #7049 (valueflow: value is not known after case) 2015-11-08 14:08:47 +01:00
PKEuS 4ad246f56f Merge pull request #703 from nablaa/hh-hxx-header
Treat *.hh and *.hxx files as C++ files
2015-11-08 13:52:56 +01:00
Alexander Mai ab296fa93f 7111 segmentation fault (invalid code) in Tokenizer::simplifyRedundantParentheses 2015-11-08 13:45:55 +01:00
Daniel Marjamäki 48da1d5396 Refactoring CheckBufferOverrun 2015-11-08 12:39:08 +01:00
PKEuS 32f0cbb6ad Fixed false positive eraseDereference with range-based for-loops (#7106) 2015-11-08 09:42:55 +01:00
Daniel Marjamäki 7d6e1974eb Fixed #7104 (False positive arrayIndexOutOfBounds) 2015-11-08 09:30:23 +01:00
Miika-Petteri Matikainen 1d4e33e792 Treat *.hh and *.hxx files as C++ files
Previously they were erroneously detected as C files.
2015-11-08 09:43:06 +02:00
PKEuS fdb596fa05 Do not set "pure" flag if function is declared as "= default" (#7101) 2015-11-07 22:21:50 +01:00
Daniel Marjamäki 35ed902e3f Try to fix crash when using getMaxValue() 2015-11-07 19:59:48 +01:00
Daniel Marjamäki 32627dc558 try to fix internal errors detected by Travis 2015-11-07 19:47:30 +01:00
Daniel Marjamäki 9c7271a5e9 CheckBufferOverrun: The simplifyKnownVariables() has been reduced, use ValueFlow instead 2015-11-07 18:12:01 +01:00
Daniel Marjamäki 3655ce7222 Fix typo in match pattern 2015-11-07 16:06:37 +01:00
Daniel Marjamäki f7a7a8a95c Fixed #6934 (False positive returnLocalVariable - assigning local array to function argument) 2015-11-07 15:07:26 +01:00
Daniel Marjamäki d0ab3aea70 CheckBufferOverrun: Minor fixes for strings 2015-11-07 15:05:56 +01:00
PKEuS 9a879fc828 Fixed false positives with pointerSize being shown even if no sizeof() is used (#7100). 2015-11-07 13:19:06 +01:00
PKEuS 49f6231756 Fixed two issues in CheckSizeof::checkSizeofForPointerSize() 2015-11-07 09:35:30 +01:00
Alexander Mai 598809a834 Fix multi-threading by converting static member variables to instance variables 2015-11-06 22:49:02 +01:00
PKEuS 0ac89c8af2 Fixed internal warning 2015-11-06 22:21:39 +01:00
PKEuS 61b16909bd Fixed false negative pointerSize with member variables.
Fixed wrong comment in testcppcheck.cpp
2015-11-06 21:48:56 +01:00