Fixed #3697.
Fixed #3676.
Improved nullpointer check:
- Fixed #3673
- Fixed potential issue with constructor calls (like #3697)
- Added support for operator+ on std::string
Improved CheckOther::checkComparisonOfBoolWithInt and CheckOther::checkComparisonOfBoolExpressionWithInt:
- Added support for comparision of bool constant with number constant (-> fixed #1877) and integer variable with boolean expression
- Moved a check from checkComparisonOfBoolWithInt to checkComparisonOfBoolExpressionWithInt
- Generalized some patterns
- Made error message more accurate concnerning the "neither 0 nor 1" part.
- Reduced number of Token::Match calls
Fixed ticket #3701 (false positive: syntax error on valid C code ( K&R function style ).
Fixed ticket #3703 (false positive: syntax error on valid C-code ( K&R - style )).
Fixed #3162: Check whole condition for suspicious find calls.
Make 'const' the new variable 'funcName'.
Improved checks in CheckStl:
- Improved message of stlIfStrFind according to discussion on github (77d9ed18775bd2181ec518b1e7d2c842bb3da644)
- Generalized pattern for substr in CheckStl::uselessCalls; added check for substr calls like ".substr(%any%,0)" which result in an empty string.
Improved checks in CheckStl:
- Generalized check for inefficient emptiness check to detect !%var%.size() calls also outside of if and while; detect it also for %var%.size() when linked with && or ||.
Refactorizations in CheckStl:
- Removed an indendation counter and an offset variable
- Reduced distance given to tokAt calls in CheckStl::redundantCondition
- Rearranged code in CheckStl::missingComparison to use more efficient comparision of varIds instead of variable names. Use varId in pattern instead of variable name.
Fix compiler warning

gcc warning:
lib/checkclass.cpp: In member function ‘void CheckClass::checkConst()’:
lib/checkclass.cpp:1197: warning: declaration of ‘name’ shadows a member of 'this'

Rename local variable 'name' to 's'.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Fixed #3650 (Variable declaration: Doesn't handle template usage well)
Improvements in checkclass.cpp:
- Generalized CheckClass::noMemset:
-- Checking for all three mem...-functions for all patterns, generalized them so that we need less patterns
-- Use nextArgument() to jump over irrelevant arguments
- Replaced CheckClass::hasDeallocation by CheckClass::hasAllocation:
-- Reduced number of false negatives by returning also true whenever a member variable is allocated (also without previous deallocation)
-- Reduced code duplication
- Removed indendation counter and redundant variable in CheckClass::initializeVarList
Fixed #3383: If there is an empty line between subsequent break statements, only issue a message for inconclusive checking
Implemented #2990: Print relative paths if -rp or --relative-paths is given
Avoid copying Settings in CppCheckExecutor
Refactorizations:
- Added forgotten initialization of Settings::_relativePaths
- Some PCRE-Rules specific code hidden behind HAVE_RULES
- Use initialization list in ErrorLogger::ErrorMessage::ErrorMessage() and CppCheck::CppCheck
- Avoided unnecessary copies of std::strings in cppcheck.cpp
- Moved "// Alert only about unique errors"-code to make it work in debugFalsePositive mode
Fixed compilation error (#3709)