Skip to content

Commit

Permalink
travis: compile one pair of jobs with -DCHECK_INTERNAL and run --enab…
Browse files Browse the repository at this point in the history
…le=internal,...

suppress warnings in testtoken.cpp
fix warnings in valueflow
  • Loading branch information
matthiaskrgr committed May 19, 2014
1 parent 5c566e8 commit 879023b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .travis_suppressions
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions lib/valueflow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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");
Expand Down

0 comments on commit 879023b

Please sign in to comment.