diff --git a/.travis.yml b/.travis.yml index 1c0cc3eec..7146bea68 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,7 @@ env: # special CXXFLAGS for maximum speed, overrides global CXXFLAGS, CHECK_KERNEL is the var that controls if we download and check the kernel in that travis job - MAKEFLAGS="HAVE_RULES=yes" SRCDIR=build VERIFY=1 - SRCDIR=build VERIFY=1 - - + - CXXFLAGS="${CXXFLAGS} -DCHECK_INTERNAL" - CXXFLAGS="-O3 -march=native -mtune=native" SRCDIR=build CHECK_KERNEL=yes matrix: @@ -46,7 +46,7 @@ script: - cd ../ # use same hack as for kernel to work around cppchecks broken exit status with -j 2 ; create file, tee everything to the file and stdout, grep for errors in the file - touch /tmp/cppcheck.cppcheck - - ./cppcheck --error-exitcode=1 -Ilib --enable=style --suppressions-list=.travis_suppressions . -j 2 |& tee /tmp/cppcheck.cppcheck + - ./cppcheck --error-exitcode=1 -Ilib --enable=style,performance,portability,warning,internal --suppressions-list=.travis_suppressions . -j 2 |& tee /tmp/cppcheck.cppcheck - sh -c "! grep '^\[' /tmp/cppcheck.cppcheck" - cd ./gui # clean rebuild diff --git a/.travis_suppressions b/.travis_suppressions index e7983ba4d..ef716f594 100644 --- a/.travis_suppressions +++ b/.travis_suppressions @@ -2,6 +2,7 @@ uselessAssignmentPtrArg:build/checkstl.cpp assertWithSideEffect:build/checkuninitvar.cpp duplicateBranch:build/checkunusedvar.cpp unusedPrivateFunction:test/testcmdlineparser.cpp +redundantNextPrevious:test/testtoken.cpp *:gui/test* *:test/test.cxx diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index 3366ea366..c1e579837 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -951,7 +951,7 @@ static void valueFlowForLoopSimplify(Token * const bodyStart, const unsigned int setTokenValue(tok2, value1); } - else if (Token::Match(tok2, ") {") && Token::findmatch(tok2->link(), "%varid%", tok2, varid)) { + else if (Token::simpleMatch(tok2, ") {") && Token::findmatch(tok2->link(), "%varid%", tok2, varid)) { if (Token::findmatch(tok2, "continue|break|return", tok2->linkAt(1), varid)) { if (settings->debugwarnings) bailout(tokenlist, errorLogger, tok2, "For loop variable bailout on conditional continue|break|return"); @@ -960,7 +960,7 @@ static void valueFlowForLoopSimplify(Token * const bodyStart, const unsigned int if (settings->debugwarnings) bailout(tokenlist, errorLogger, tok2, "For loop variable skipping conditional scope"); tok2 = tok2->next()->link(); - if (Token::Match(tok2, "} else {")) { + if (Token::simpleMatch(tok2, "} else {")) { if (Token::findmatch(tok2, "continue|break|return", tok2->linkAt(2), varid)) { if (settings->debugwarnings) bailout(tokenlist, errorLogger, tok2, "For loop variable bailout on conditional continue|break|return");