Commit Graph

1199 Commits

Author SHA1 Message Date
PKEuS 3c8f5b85ae Refactorization: Allocate Token::_values (ValueFlow information) dynamically, reducing size of each token by around 10% 2017-03-27 18:48:34 +02:00
Daniel Marjamäki f5d56fd303 Fixed #7961 (Hang in CheckOther::checkFuncArgNamesDifferent) 2017-03-24 22:01:05 +01:00
PKEuS 00904ba32a Fixed false negatives in CheckOther::checkPassByReference() when assignment operator is used. 2017-03-07 21:49:28 +01:00
PKEuS 3da1de7893 Do not exclude std::shared_ptr and std::unique_ptr from checkPassByReference() (#7834)
These two types are larger than one pointer. Hence, passing by reference is faster.
2017-03-07 21:18:08 +01:00
PKEuS 1c3f010935 Fixed false positive: Exclude STL shared pointers from checkPassByReference() (#7834) 2017-03-07 21:04:19 +01:00
Daniel Marjamäki ecc59859e1 Don't simplify _Bool in TokenList 2017-03-04 11:13:28 +01:00
Daniel Marjamäki b1ce229006 Small refactoring 2017-03-03 19:09:32 +01:00
Daniel Marjamäki 59c1c76a97 Fixed #7466 (Reference variable does not count side-effects (FP variableScope)) 2017-03-03 19:07:00 +01:00
Ville Skyttä 2ccd5aec1a Comment spelling fixes
Add an optional extended description…
2017-02-28 12:22:59 +01:00
PKEuS 3022d74801 Do not suggest pass by reference for std::initializer_list 2017-01-19 11:14:55 +01:00
Robert Reif 139071d88b Fixed #7875 (New check: function declaration and definition argument names don't match) 2017-01-05 08:52:11 +01:00
Daniel Marjamäki 770abcf453 Fixed #5398 (False positive: Scope of variable can be reduced does not account for other variables not reduceable) 2016-12-26 14:14:40 +01:00
Roberto Martelloni 04f24b4220 CWE mapping of accessMoved, accessForwarded, nullPointerArithmeticRedundantCheck, nullPointerArithmetic 2016-12-24 23:07:37 +00:00
Daniel Marjamäki df6ae9f3b4 Fixed #7847 (Can't detect shift negative values when some op is executed) 2016-12-22 09:40:19 +01:00
Frank Zingsheim 9a871d33f7 Improve Fix #6180 ("reset" and "clear" clears the move status) 2016-12-17 16:39:30 +01:00
PKEuS 2f6350a0d0 Refactorized Library 2016-12-06 14:09:28 +01:00
Matthias Krüger 4cf85b72b6 CheckOther::checkAccessOfMovedVariable: don't warn if --enable=warning is not given. 2016-11-20 18:44:37 +01:00
Frank Zingsheim c8ff96fe8f Fixed #6180 (Usage of variable after std::move or std::forward) 2016-11-20 15:14:49 +01:00
PKEuS e23dc5c1e2 Fixed wrong message shown if unused label appears directly after a switch() scope 2016-11-20 14:43:54 +01:00
orbitcowboy 919f8ac323 Fixed typos. There are no real changes. 2016-11-04 15:01:05 +01:00
Daniel Marjamäki a85eacc157 cstyleCast: don't warn about '(const Variable *)nullptr' 2016-10-18 22:56:33 +02:00
Boris Egorov 0154d39bf6 Show struct member in unsignedLessThanZeroError warning
Before:
    [/tmp/test.c:8]: (style) Checking if unsigned variable '.' is less than zero.
    [/tmp/test.c:12]: (style) Checking if unsigned variable '.' is less than zero.

After:
    [/tmp/test.c:8]: (style) Checking if unsigned variable 'd.n' is less than zero.
    [/tmp/test.c:12]: (style) Checking if unsigned variable 'd.n' is less than zero.
2016-09-22 08:03:30 +07:00
Matthias Krüger 2f39ed6f88 redundantPointerOpError: put pointer name into single quotes in the error message. 2016-09-16 22:18:24 +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
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
Roberto Martelloni 01ee9ee5e6 CWE mapping of invalidLengthModifierError, leakUnsafeArgAlloc, nullPointerDefaultArg, nullPointerRedundantCheck, raceAfterInterlockedDecrement. 2016-08-24 15:37:14 +01:00
Daniel Marjamäki bd21cd7c85 Fixed #6309 (FP: checkRedundantAssignment should not warn for pointer alias) 2016-08-08 21:43:00 +02:00
PKEuS ad96f7b519 Fixed wrong variable being used in CheckOther::checkPassByReference() 2016-08-04 15:30:59 +02:00
PKEuS 452ecc7ceb Improved check: Detect passedByValue even for arguments that are not declared as "const" 2016-07-28 19:37:10 +02:00
Daniel Marjamäki 0767284ca1 Fixed #7630 (FP: dead store, modifying array, index var modified) 2016-07-25 07:35:33 +02:00
Daniel Marjamäki 03d2829fb9 Merge simplecpp branch 2016-07-20 12:21:00 +02:00
Daniel Marjamäki f55040a987 Fix segfault when there is no ast generated in lambda function 2016-07-18 14:08:44 +02:00
Daniel Marjamäki 0ddeac0429 refactor (use ast) and improve CheckOther::checkRedundantAssignment (warn about global variables unless they are volatile, handle arrays in lhs better) 2016-07-18 12:43:23 +02:00
PKEuS 7a183779e2 CheckOther::checkMemsetZeroBytes(): Support wmemset() 2016-07-16 21:53:25 +02:00
Daniel Marjamäki d1f06ff47c Fixed #7175 (False positive performance warning (buffer overwritten before its old content has been used)) 2016-06-13 15:46:43 +02:00
Roberto Martelloni dce7128f30 CWE mapping of duplicateExpression, duplicateBreak (CWE561), unreachableCode, unsignedLessThanZero, unsignedPositive, pointerLessThanZero, pointerPositive, varFuncNullUB, nanInArithmeticExpression, commaSeparatedReturn, (#797)
ignoredReturnValue
2016-05-22 13:17:38 +02:00
Roberto Martelloni afa8ad0ebe CWE mapping of selfAssignment, wrongmathcall, unpreciseMathCall, memsetZeroBytes, memsetFloat, memsetValueOutOfRange, clarifyCalculation, clarifyStatement 2016-05-14 10:13:33 +01:00
PKEuS 0bf85f9aa5 ValueType: Support integers defined in libraries (#7394) 2016-05-04 15:39:56 +02:00
Roberto Martelloni 01aaa56740 CWE mapping of redundantCopy, redundantAssignment, constStatement, charBitOp, variableScope, redundantAssignInSwitch, redundantCopyInSwitch, switchCaseFallThrough 2016-04-29 18:01:37 +01:00
Daniel Marjamäki dc2a92263a Fixed #7426 (RFC: time to replace simplifyEnum?) 2016-04-22 06:02:54 +02:00
Daniel Marjamäki 00a584d8d1 astyle formatting 2016-04-22 06:01:34 +02:00
Roberto Martelloni e89cd1b8a4 CWE mapping of unsafeClassCanLeak, zerodivcond, invalidPointerCast, redundantCopy, redundantAssignment, comparisonFunctionIsAlwaysTrueOrFalse, checkCastIntToCharAndBack, cstyleCast, passedByValue, clarifyCondition, exceptThrowInDestructor, exceptDeallocThrow, exceptRethrowCopy, catchExceptionByValue, fflushOnInputStream, seekOnAppendedFile, publicAllocationError
CWE mapping of unsafeClassCanLeak, zerodivcond, invalidPointerCast, redundantCopy, redundantAssignment, comparisonFunctionIsAlwaysTrueOrFalse, checkCastIntToCharAndBack, cstyleCast, passedByValue, clarifyCondition, exceptThrowInDestructor, exceptDeallocThrow, exceptRethrowCopy, catchExceptionByValue, fflushOnInputStream, seekOnAppendedFile, publicAllocationError
2016-04-12 19:29:40 +02:00
Dmitry-Me 1f27c4b76b Merge pull request #771 from Dmitry-Me/charUsedAsArrayIndex
Portability warning when 'char' type is used as array index
2016-02-10 20:11:38 +03:00
Dmitry-Me c3399493ef Portability warning when 'char' type is used as array index 2016-02-08 10:08:35 +03:00
PKEuS b3a0d418e6 Refactorization: Compare only as much characters as necessary in Preprocessor
Fixed internal message
2016-02-05 21:06:07 +01:00
PKEuS c66db46f66 Use ValueType in CheckOther::checkSignOfUnsignedVariable()
Fixed travis: replaced std::string::pop_back by std::string::substr
2016-02-05 20:43:06 +01:00
PKEuS b4b38fb7ce Use ValueType in CheckOther::invalidPointerCast()
False negative: operator new is currently not supported by ValueType.
2016-02-05 20:28:43 +01:00
PKEuS 841f17776b Set ValueType for assignment operators, detect division by zero for %= and /= again (#7322) 2016-02-02 17:17:55 +01:00