Commit Graph

8264 Commits

Author SHA1 Message Date
Simon Martin f816fb811e Ticket #7680: Properly handle ::delete during memory leak checks. 2016-09-10 14:55:50 +02:00
Daniel Marjamäki ac1a869d60 unused struct members: don't warn about packed structs (#3088) 2016-09-05 17:27:12 +02:00
Daniel Marjamäki 4d22ada078 Fixed #5839 (False positive: Function can be const, if this is passed to functor) 2016-09-04 16:36:04 +02:00
Daniel Marjamäki ce7bfba416 Refactoring CheckClass::checkConst. Use continue. 2016-09-04 16:06:54 +02:00
Daniel Marjamäki 54db79305b Redo refactoring of CheckClass::checkConst. 2016-09-04 16:02:59 +02:00
Daniel Marjamäki 530a05e40e Refactoring CheckClass::checkConst. Use continue. 2016-09-04 15:38:56 +02:00
Daniel Marjamäki 03a6282ab3 Fixed #7338 (Library: method in base class) 2016-09-04 14:14:21 +02:00
Daniel Marjamäki 60f22bd4ee Fixed #7477 (False positive 'Assigned value is never used' in multithreaded context) 2016-09-03 20:38:36 +02:00
Daniel Marjamäki b97bdb5300 bump simplecpp to rev b50ced8ac14f8debab9e85e78036f881ff2b3965 2016-09-03 12:29:45 +02:00
Roberto Martelloni 28f1222dc2 CWE mapping of useAutoPointerMalloc, uselessCallsCompare, uselessCallsSwap, uselessCallsSubstr, uselessCallsEmpty, uselessCallsRemove, derefInvalidIterator, reademptycontainer, multiplySizeof, divideSizeof, stringLiteralWrite, incorrectStringCompare, literalWithCharPtrCompare, charLiteralWithCharPtrCompare, incorrectStringBooleanError, staticStringCompare, stringCompare, signConversion, truncLongCastAssignment, truncLongCastReturn, unusedFunction, unusedVariable, unusedAllocatedMemory, unreadVariable, unassignedVariable, unusedStructMember, postfixOperator, va_start_wrongParameter (#824)
Add an optional extended description…
2016-09-03 00:31:35 +02:00
Daniel Marjamäki 0e48625ff4 Fixed false positive when self-checking Cppcheck 'boolean result used in bitwise operation' when using boolean variables. 2016-08-29 04:09:36 +02:00
Daniel Marjamäki 24c6d92667 astyle formatting
[ci skip]
2016-08-29 04:08:38 +02:00
Daniel Marjamäki 939b42df06 Fixed #7134 (False positive redundantAssignment - assignment to local variable of unknown type) 2016-08-29 03:48:08 +02:00
Daniel Marjamäki 18cab009c1 Fix Token::Match pattern 2016-08-28 19:25:57 +02:00
Daniel Marjamäki 254e5675ff Fixed #7573 (Tokenizer: FP caused by constant folding) 2016-08-28 19:11:05 +02:00
Daniel Marjamäki fee0e4edfa Fixed #7177 (MathLib: Does not handle '\xF6' properly) 2016-08-28 11:37:05 +02:00
Robert Reif bf7ef56ef5 Fixed #7713 (False positive: %hhu in format string (no. 1) requires 'unsigned char' but the argument type is 'signed int'.) 2016-08-26 19:47:36 +02:00
orbitcowboy 87409ea6b3 Running astyle; Improved testing of std::find; std.cfg: Added support for istream::read and ifstream::read. 2016-08-25 19:17:07 +02:00
Roberto Martelloni 1db24ee070 CWE mapping of signedCharArrayIndex, unknownSignCharArrayIndex, suspiciousCase, suspiciousEqualityComparison, duplicateBranch, duplicateExpressionTernary, suspiciousSemicolon, incompleteArrayFill, redundantPointerOp, unusedLabelSwitch, unusedLabel, unknownEvaluationOrder, stlIfFind, useAutoPointerCopy 2016-08-25 15:40:23 +01:00
amai2012 ece478979b Merge pull request #821 from boos/cwe-mapping-11
CWE mapping of invalidLengthModifierError, leakUnsafeArgAlloc, nullPointerDefaultArg, nullPointerRedundantCheck, raceAfterInterlockedDecrement.
2016-08-24 20:44:06 +02:00
Roberto Martelloni 01ee9ee5e6 CWE mapping of invalidLengthModifierError, leakUnsafeArgAlloc, nullPointerDefaultArg, nullPointerRedundantCheck, raceAfterInterlockedDecrement. 2016-08-24 15:37:14 +01:00
Dmitry-Me 667038a402 Merge overlapping patterns 2016-08-24 15:10:39 +03:00
Robert Reif 6043a27065 Fixed #7710 (%h and %hh printf type size specifiers not supported) 2016-08-24 12:47:11 +02:00
Daniel Marjamäki 706877df2d astyle formatting
[ci skip]
2016-08-24 12:43:45 +02:00
amai2012 7cc2124176 Fix crash in parsing solution/project 2016-08-24 12:17:54 +02:00
amai2012 c0401c2ef5 Merge pull request #820 from boos/cwe-mapping-10
CWE mapping of functionConst, functionStatic, initializerList, badBitmaskCheck, knownConditionTrueFalse, invalidTestForOverflow, unhandledExceptionSpecification, coutCerrMisusage,  invalidPrintfArgType_int
2016-08-24 09:48:01 +02:00
Roberto Martelloni 4c6f4f6708 CWE mapping of functionConst, functionStatic, initializerList, badBitmaskCheck, knownConditionTrueFalse, invalidTestForOverflow, unhandledExceptionSpecification, coutCerrMisusage,
invalidPrintfArgType_int
2016-08-23 16:48:36 +01:00
Dmitry-Me cd6aa27010 Clarify loop logic
* clearer variable names
* don't rely on npos being outside indices range - explicitly break the loop instead
2016-08-23 18:27:07 +03:00
Frank Zingsheim 8c8a534117 SymbolDatabase: stronger type matching 2016-08-21 16:11:23 +02:00
Frank Zingsheim 7c9a69357e Fixed #7696 (cppcheck 1.75 runs very slowly with style and/or performance checks) 2016-08-21 16:07:05 +02:00
Daniel Marjamäki bea35ee04c GUI: Select configuration that is checked 2016-08-21 15:57:38 +02:00
Daniel Marjamäki a94628d8fc Settings: Make Settings::_terminated static. All threads and subchecks are terminated 2016-08-21 15:57:19 +02:00
Daniel Marjamäki d9ebdc6a10 Preprocessor: fix handling of -U in Preprocessor::getConfigs() 2016-08-21 15:01:04 +02:00
Daniel Marjamäki ff036c8742 Fixed #7700 (Using -D to force a configuration still checks the configuration as well as configurations that are not relevant) 2016-08-21 13:53:44 +02:00
Daniel Marjamäki 19c105cdf9 Fixed #7677 (skipping of configurations broken?) 2016-08-21 12:31:26 +02:00
PKEuS e0838ff194 Fixed crash on garbage code (#7699) 2016-08-21 11:06:48 +02:00
Daniel Marjamäki 363605906f Fixed #7695 (Running with -U_WIN32 still checks related configurations) 2016-08-21 07:45:15 +02:00
Robert Reif 62ac40fc5e Fixed #7706 ((debug) Executable scope 'foo' with unknown function.) 2016-08-20 22:43:27 +02:00
Robert Reif 1dd1f6dd6a Fixed #7673 ((debug) Executable scope 'foo' with unknown function.) 2016-08-20 17:56:48 +02:00
Daniel Marjamäki fe2fa4d343 GUI: Only check current platform when checking sln/vcxproj file 2016-08-20 13:47:25 +02:00
Daniel Marjamäki f1d0498418 ImportProject: Fix crash when there is condition $(Configuration.Contains('X')) 2016-08-20 13:00:47 +02:00
Daniel Marjamäki 079051a4e4 ImportProject: UseOfMfc => define __AFXWIN_H__ 2016-08-20 12:20:04 +02:00
Daniel Marjamäki 8a66535399 Fixed #7694 (ValueType: 1.23L) 2016-08-20 08:44:53 +02:00
Robert Reif b56c765a45 Fixed #7703 ((debug) Executable scope 'foo' with unknown function.) 2016-08-20 07:43:15 +02:00
Robert Reif f1b5ac30a7 Fixed 7698 (FP syntaxError with enum (1.75 regression)) 2016-08-19 19:09:52 +02:00
Robert Reif 1e999e0cfe Fixed #7697 ((debug) Executable scope 'B' with unknown function.) 2016-08-19 19:06:15 +02:00
Daniel Marjamäki 789aef7fde Fixed #4920 (Microsoft ATL/MFC CString::Format argument checking) 2016-08-19 17:36:27 +02:00
Daniel Marjamäki 305609f4fb Fixed #7688 (setTokenValue: crash when there is no 2nd operand for ternary operator) 2016-08-17 18:44:41 +02:00
Daniel Marjamäki 499e52c976 astyle formatting
[ci skip]
2016-08-15 18:04:55 +02:00
Daniel Marjamäki 1f98af654a ValueFlow: better handling of ? when condition result is known 2016-08-15 14:19:35 +02:00
amai2012 453b5577cd Merge pull request #819 from boos/cwe-mapping-9
CWE mapping of assignBoolToFloat, strncatUsage, sizeArgumentAsChar, terminateStrncpy, bufferNotZeroTerminated, negativeArraySize, noExplicitConstructor, virtualDestructor
2016-08-15 09:20:59 +02:00
Daniel Marjamäki 62362cd06d ValueFlow: improve handling of unary minus 2016-08-14 22:19:06 +02:00
Roberto Martelloni 41dee04e90 CWE mapping of assignBoolToFloat, strncatUsage, sizeArgumentAsChar, terminateStrncpy, bufferNotZeroTerminated, negativeArraySize, noExplicitConstructor, virtualDestructor 2016-08-14 18:23:41 +01:00
Daniel Marjamäki f2e49b4db4 Fixed #7178 (Defect: False positive due to mistake in return type of function pointer.) 2016-08-14 17:19:14 +02:00
Daniel Marjamäki c8667096e0 Fixed #7658 (False positive: Same iterator is used with different containers) 2016-08-14 10:49:48 +02:00
Robert Reif 73e1378af8 Fixed #7661 (False positive: Function parameter 'e' should be passed by reference.) 2016-08-13 21:25:57 +02:00
Daniel Marjamäki 2ed50fbf5a Refactoring 2016-08-13 15:23:46 +02:00
Daniel Marjamäki 606e31602c Fixed #7177 (Support compile_commands.json) 2016-08-13 10:50:03 +02:00
Robert Reif fc1a755100 Fixed #7666 (Executable scope with unknown function.) 2016-08-09 14:02:06 +02:00
Daniel Marjamäki bd21cd7c85 Fixed #6309 (FP: checkRedundantAssignment should not warn for pointer alias) 2016-08-08 21:43:00 +02:00
Daniel Marjamäki c586ae8cbe Revert 'project' - it is not ready yet 2016-08-07 17:10:37 +02:00
Bartlomiej Grzeskowiak 09a83f2cc8 Fixed #7567 ("(a | 7) > 6U" is always true) 2016-08-07 16:58:39 +02:00
Daniel Marjamäki 78fc307c73 1 2016-08-07 15:45:36 +02:00
Daniel Marjamäki 4dbdb50317 split 2016-08-07 15:35:41 +02:00
Daniel Marjamäki 70ccfa5947 fix loading of vcxproj files 2016-08-07 14:21:06 +02:00
Daniel Marjamäki e0f4ce9358 vs 2016-08-07 13:55:27 +02:00
Daniel Marjamäki f0727f2148 Merge branch 'master' into project 2016-08-06 21:05:29 +02:00
Daniel Marjamäki 09d6f4f0a4 1 2016-08-06 21:04:50 +02:00
Frank Zingsheim 47c063e13f Fixed #7660 (cmake build does not handle simplecpp) 2016-08-06 18:21:54 +02:00
Daniel Marjamäki a8df08f22b Fixed #7659 (crash: Token::varId() : vxl: brdb_selection.cxx) 2016-08-06 18:07:41 +02:00
Daniel Marjamäki b86c2689b3 TestPreprocessor: Fix output 2016-08-06 13:28:24 +02:00
Daniel Marjamäki 2f1c80560a 1.75: Set versions 2016-08-06 11:47:27 +02:00
Robert Reif cdfe92b753 Fixed #7657 (False positive: Function parameter 'c' should be passed by reference.) 2016-08-06 10:27:00 +02:00
Daniel Marjamäki 8983997a88 Fix GCC warning 2016-08-06 10:22:58 +02:00
Daniel Marjamäki 3777db39db Preprocessor: Mostly refactorings. Also added handling of --include. 2016-08-06 09:15:09 +02:00
Dmitry-Me 89e8f51a28 Explicit continue instead of init-set-check 2016-08-05 15:05:37 +03:00
Daniel Marjamäki 7d6c587580 Fixed #6113 (Tokenizer::simplifyFunctionPointer: wrong simplification of usage 'return (*f)();') 2016-08-04 19:10:08 +02:00
PKEuS 084fcc936c Rephrased syntaxError message for empty configurations to improve readability:
Old: Invalid number of character 'c' when these macros are defined: ''.
New: Invalid number of character 'c' when no macros are defined.
2016-08-04 16:28:11 +02:00
PKEuS ad96f7b519 Fixed wrong variable being used in CheckOther::checkPassByReference() 2016-08-04 15:30:59 +02:00
Daniel Marjamäki 9711064b74 Fixed #6646 (False positive uninitvar - loopvariable initialized inside loop) 2016-08-04 14:39:54 +02:00
amai2012 0bec604627 Repair CWE mapping for calling obsolete functions 2016-08-04 13:55:38 +02:00
Daniel Marjamäki 2566fd09da Fixed #5803 (False positive: Same iterator is used with different containers - insert() from range of different container) 2016-08-04 09:35:16 +02:00
Robert Reif 55b3f0bf38 Fixed #752 (SymbolDatabase: Does not match function if redundant keywords mismatch (C++)) 2016-08-04 09:06:32 +02:00
Dmitry-Me 7f30108f1d Descriptive variable name 2016-08-03 18:15:08 +03:00
Robert Reif b40edca62f Fixed #7387 (SymbolDatabase: Wrong overloaded function is picked) 2016-08-02 23:34:11 +02:00
Robert Reif b9030bcfcd Fixed #7650 (SymbolDatabase: Wrong Token::type(), enum and class with same name) 2016-08-02 23:30:46 +02:00
Daniel Marjamäki 908e1b991e Tokenizer: Refactoring simplifyPlatformTypes() 2016-08-02 19:44:18 +02:00
Daniel Marjamäki 9f59bd6dae Try to fix travis hang 2016-08-02 19:23:45 +02:00
Robert Reif b44f448acc Fixed #7649 (SymbolDatabase: Wrong overloaded function is picked for char and wchar_t) 2016-08-02 18:54:01 +02:00
Daniel Marjamäki f23287544a Fixed #7196 (Improve check: deem sizeof(thing) as using the thing's members) 2016-08-02 18:50:04 +02:00
Daniel Marjamäki cc62259103 Tokenizer: don't set varid on c++11 'template using' type. 2016-08-02 15:04:07 +02:00
Robert Reif 612e83d5af SymbolDatabase: Small fix 2016-08-02 14:31:07 +02:00
Daniel Marjamäki 2187e8ba02 CheckUninitVar: Fixed FP when dereferencing multidimensional arrays. Refactoring of testing. The FP was spotted when looking at #7092 2016-08-02 14:27:51 +02:00
Daniel Marjamäki 99b23012aa Refactoring, use Settings::platformString() 2016-08-02 10:53:51 +02:00
Robert Reif 891e21b478 Fixed #7458 (SymbolDatabase: Wrong overloaded function is picked) 2016-08-02 08:58:11 +02:00
Daniel Marjamäki 41526ef3a8 Fixed #6147 (FP unreadVariable: variable assignment in function call argument list) 2016-08-02 08:50:04 +02:00
Daniel Marjamäki 31484133c0 Fixed #7158 (Tokenizer::createLinks2(): does not set links for < > in 'enum { value = boost::mpl::at_c<B,C> };') 2016-08-01 22:26:11 +02:00
Daniel Marjamäki e784901303 Fixed #6971 (False positive duplicateExpressionTernary - cast ignored) 2016-08-01 21:53:43 +02:00
Daniel Marjamäki 695b1f0ef3 Fixed #5692 (Preprocessor: ifdef symbol used indirectly in code leads to 'analysis failed') 2016-08-01 20:09:41 +02:00
PKEuS da34883770 Improved message invalidscanf: Removed misleading example from verbose message 2016-08-01 18:42:27 +02:00