cppcheck/lib
Paul Fultz II f603b529df Fix issue 8413: Condition is always false 'i=expr; if (i != expr) {}' (#1295)
* Follow variables when comparing same expression

* Remove assert include

* Dont follow function arguments

* Improve the checking to check more cases

* Add more tests

* Check if the variable is used inside a loop

* Follow both variables

* Only skip loops when variable is modified in scope

* Fix FP when followed variable is modified

* Dont follow arrays

* Skip pointer indirection

* Make recursive

* Improve checking more variables

* Fix test with sizeof

* Skip following operators

* Fix test when using sizeof

* Dont check every step

* Use early returns

* Update test to use a loop instead of conditional

* Add static

* Check variables are global

* Check local variables in another scope

* Fix issue with const pointers

* Distinguish between pointer indirection and multiply

* Use simple match

* Prevent crash with uniform initialization

* Use unary op and ast to detect pointer indirection

* Expand error message when expression do not match exactly

* Add errorpath to issameexpression

* Revert "Clarify warning message for 'Same expression on both sides of operator'"

This reverts commit 0e491b41a8.

* Check if the tokens are the same

* Report the operator and not the expressions
2018-08-07 09:32:16 +02:00
..
CMakeLists.txt Fixed #7660 (cmake build does not handle simplecpp) 2016-08-06 18:21:54 +02:00
analyzerinfo.cpp refactoring; use range for loops 2018-07-13 22:56:20 +02:00
analyzerinfo.h Renamed private member analyzerInfoFile 2018-06-17 08:11:48 +02:00
astutils.cpp Fix issue 8413: Condition is always false 'i=expr; if (i != expr) {}' (#1295) 2018-08-07 09:32:16 +02:00
astutils.h Fix issue 8413: Condition is always false 'i=expr; if (i != expr) {}' (#1295) 2018-08-07 09:32:16 +02:00
check.cpp Renamed Check::_name 2018-06-16 16:31:07 +02:00
check.h Renamed Check::_name 2018-06-16 16:31:07 +02:00
check64bit.cpp Rename _tokenizer, _settings, _errorLogger 2018-06-16 16:10:28 +02:00
check64bit.h Updated copyright year for modified files 2018-06-10 22:07:21 +02:00
checkassert.cpp Rename _tokenizer, _settings, _errorLogger 2018-06-16 16:10:28 +02:00
checkassert.h Updated copyright year for modified files 2018-06-10 22:07:21 +02:00
checkautovariables.cpp Refactoring; Use Token::isUnaryOp() to clarify code 2018-07-13 23:02:52 +02:00
checkautovariables.h Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
checkbool.cpp Refactoring; Use Token::isBinaryOp() to clarify code, use early continue in loop 2018-07-13 23:06:45 +02:00
checkbool.h Add some missing errors to --errorlist output. (#1292) 2018-06-20 10:43:13 +02:00
checkboost.cpp Rename _tokenizer, _settings, _errorLogger 2018-06-16 16:10:28 +02:00
checkboost.h Updated copyright year for modified files 2018-06-10 22:07:21 +02:00
checkbufferoverrun.cpp Refactoring; Use Token::isUnaryOp() to clarify code 2018-07-13 23:12:20 +02:00
checkbufferoverrun.h Rename private member variables 2018-06-17 17:20:16 +02:00
checkclass.cpp Fixed #8636 (Misleading verbose message if virtual method called from destructor) 2018-07-26 09:16:17 +02:00
checkclass.h Rename private member variable 2018-06-17 18:43:54 +02:00
checkcondition.cpp astyle formatting 2018-08-05 22:40:21 +02:00
checkcondition.h Updated copyright year for modified files 2018-06-10 22:07:21 +02:00
checkexceptionsafety.cpp Refactoring; Use range for loops 2018-07-14 09:49:03 +02:00
checkexceptionsafety.h Updated copyright year for modified files 2018-06-10 22:07:21 +02:00
checkfunctions.cpp astyle formatting 2018-08-05 10:48:28 +02:00
checkfunctions.h Updated copyright year for modified files 2018-06-10 22:07:21 +02:00
checkinternal.cpp Rename _tokenizer, _settings, _errorLogger 2018-06-16 16:10:28 +02:00
checkinternal.h Updated copyright year for modified files 2018-06-10 22:07:21 +02:00
checkio.cpp Refactoring: Use range for loops 2018-07-14 10:02:32 +02:00
checkio.h Updated copyright year for modified files 2018-06-10 22:07:21 +02:00
checkleakautovar.cpp Refactoring: use range for loops 2018-07-14 09:54:52 +02:00
checkleakautovar.h Updated copyright year for modified files 2018-06-10 22:07:21 +02:00
checkmemoryleak.cpp Renamed --debug to --debug-simplified 2018-08-05 11:19:20 +02:00
checkmemoryleak.h Refactorings in CheckMemoryLeak 2018-06-18 09:40:27 +02:00
checknullpointer.cpp Clarify code with Token::isUnaryOp() 2018-07-14 10:26:22 +02:00
checknullpointer.h Updated copyright year for modified files 2018-06-10 22:07:21 +02:00
checkother.cpp Fix issue 8413: Condition is always false 'i=expr; if (i != expr) {}' (#1295) 2018-08-07 09:32:16 +02:00
checkother.h Fix issue 8413: Condition is always false 'i=expr; if (i != expr) {}' (#1295) 2018-08-07 09:32:16 +02:00
checkpostfixoperator.cpp Refactoring: Use ranged for loop 2018-07-13 16:50:12 +02:00
checkpostfixoperator.h Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
checksizeof.cpp Refactoring: Use ranged for loops 2018-07-13 16:40:15 +02:00
checksizeof.h Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
checkstl.cpp astyle formatting 2018-08-05 10:48:28 +02:00
checkstl.h Fix issue 4693: Diagnostic when using the same iterators to an algorithm (#1326) 2018-08-05 09:10:54 +02:00
checkstring.cpp Revert "Refactoring endsWith utility function" 2018-07-25 16:14:43 +02:00
checkstring.h Clarify warnings when char literals are converted to bool in conditions 2018-07-21 18:40:06 +02:00
checktype.cpp Refactoring; use range for loop 2018-07-13 16:57:17 +02:00
checktype.h Updated copyright year for modified files 2018-06-10 22:07:21 +02:00
checkuninitvar.cpp Rename _tokenizer, _settings, _errorLogger 2018-06-16 16:10:28 +02:00
checkuninitvar.h Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
checkunusedfunctions.cpp Rename private member variables 2018-06-17 18:58:27 +02:00
checkunusedfunctions.h Rename private member variables 2018-06-17 18:58:27 +02:00
checkunusedvar.cpp Rename private member variables 2018-06-17 19:04:06 +02:00
checkunusedvar.h Rename private member variables 2018-06-17 19:04:06 +02:00
checkvaarg.cpp Rename _tokenizer, _settings, _errorLogger 2018-06-16 16:10:28 +02:00
checkvaarg.h Updated copyright year for modified files 2018-06-10 22:07:21 +02:00
config.h Removed non-standard code annotations with __attribute__ 2016-01-09 09:33:56 +01:00
cppcheck.cpp Renamed --debug to --debug-simplified 2018-08-05 11:19:20 +02:00
cppcheck.h Rename private member variables 2018-06-17 19:20:07 +02:00
cppcheck.natvis Fixed Visual Studio Natvis file after recent refactoring (#1299) 2018-07-09 08:27:26 +02:00
cppcheck.vcxproj Copy platforms/ directory to bin/ 2018-02-27 09:09:12 +01:00
cppcheck.vcxproj.filters Fixed travis build by replacing Token::Match by simpleMatch() 2017-03-16 21:15:10 +01:00
errorlogger.cpp V817 It is more efficient to seek '\t' character rather than a string. errorlogger.cpp 448 (#1290) 2018-06-17 16:39:28 +02:00
errorlogger.h Rename _symbolNames 2018-06-17 07:59:48 +02:00
importproject.cpp fixed issue 8661: Misleading error message when compilation database is not recognized 2018-07-25 16:26:25 +02:00
importproject.h fixed issue 8661: Misleading error message when compilation database is not recognized 2018-07-25 16:26:25 +02:00
lib.pri Added --cppcheck-build-dir flag 2016-10-29 12:18:11 +02:00
library.cpp Rename Library::isargvalid() 2018-07-15 23:05:48 +02:00
library.h Rename Library::isargvalid() 2018-07-15 23:05:48 +02:00
matchcompiler.h Update copyright year to 2007-2016. 2016-01-01 15:34:45 +02:00
mathlib.cpp Rename private member variables 2018-06-17 17:04:34 +02:00
mathlib.h Rename private member variables 2018-06-17 17:04:34 +02:00
path.cpp Updated copyright year for modified files 2018-06-10 22:07:21 +02:00
path.h Updated copyright year 2018-01-14 15:37:52 +01:00
pathmatch.cpp Rename private member variables 2018-06-17 19:20:07 +02:00
pathmatch.h Rename private member variables 2018-06-17 19:20:07 +02:00
pcrerules.pri
platform.cpp Updated copyright year 2018-03-31 20:59:09 +02:00
platform.h Updated copyright year 2018-03-31 20:59:09 +02:00
preprocessor.cpp Refactoring; use range for loops 2018-07-15 15:03:08 +02:00
preprocessor.h Renamed private member file0 2018-06-17 09:06:16 +02:00
settings.cpp Renamed --debug to --debug-simplified 2018-08-05 11:19:20 +02:00
settings.h Renamed --debug to --debug-simplified 2018-08-05 11:19:20 +02:00
standards.h Updated copyright year 2018-01-14 15:37:52 +01:00
suppressions.cpp Refactoring: Use range for loops 2018-07-15 14:51:33 +02:00
suppressions.h Renamed _fileName 2018-06-17 08:19:10 +02:00
symboldatabase.cpp Revert "SymbolDatabase: Improved lookup of function calls" 2018-06-26 23:14:12 +02:00
symboldatabase.h Code cleanup 2018-06-20 10:39:21 +02:00
templatesimplifier.cpp Refactoring: Use range for loops 2018-07-15 14:45:15 +02:00
templatesimplifier.h Renamed _codeWithTemplates 2018-06-16 22:03:04 +02:00
timer.cpp Rename private member variables 2018-06-17 17:20:16 +02:00
timer.h Rename private member variables 2018-06-17 17:20:16 +02:00
token.cpp Improve checking of mismatch iterators (#1293) 2018-07-26 22:00:48 +02:00
token.h Refactoring, use Token::isUnaryOp and Token::isBinaryOp 2018-07-13 18:52:03 +02:00
tokenize.cpp Renamed --debug to --debug-simplified 2018-08-05 11:19:20 +02:00
tokenize.h Rename private variable maxtime 2018-06-18 09:49:00 +02:00
tokenlist.cpp Renamed _isC and _isCPP 2018-06-16 16:28:03 +02:00
tokenlist.h Renamed _isC and _isCPP 2018-06-16 16:28:03 +02:00
utils.h Revert "Refactoring endsWith utility function" 2018-07-25 16:14:43 +02:00
valueflow.cpp astyle formatting 2018-07-25 23:02:16 +02:00
valueflow.h Updated copyright year 2018-01-14 15:37:52 +01:00
version.h Set version to 1.84.99/1.85 dev 2018-06-25 21:03:43 +02:00
version.rc