fixed some clang warnings (#2980)

This commit is contained in:
Oliver Stöneberg 2020-12-26 13:46:28 +01:00 committed by GitHub
parent 765c1ace87
commit fa8a836925
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -47,6 +47,7 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wno-missing-braces) add_compile_options(-Wno-missing-braces)
add_compile_options(-Wno-unused-function) add_compile_options(-Wno-unused-function)
add_compile_options_safe(-Wextra-semi-stmt) add_compile_options_safe(-Wextra-semi-stmt)
add_compile_options_safe(-Wcomma)
if(ENABLE_COVERAGE OR ENABLE_COVERAGE_XML) if(ENABLE_COVERAGE OR ENABLE_COVERAGE_XML)
message(FATAL_ERROR "Do not use clang for generate code coverage. Use gcc.") message(FATAL_ERROR "Do not use clang for generate code coverage. Use gcc.")

View File

@ -198,7 +198,7 @@ static std::string str(ExprEngine::ValuePtr val)
case ExprEngine::ValueType::BailoutValue: case ExprEngine::ValueType::BailoutValue:
typestr = "BailoutValue"; typestr = "BailoutValue";
break; break;
}; }
std::ostringstream ret; std::ostringstream ret;
ret << val->name << "=" << typestr << "(" << val->getRange() << ")"; ret << val->name << "=" << typestr << "(" << val->getRange() << ")";
@ -2520,7 +2520,7 @@ static std::string execute(const Token *start, const Token *end, Data &data)
// This is intended for testing // This is intended for testing
throw ExprEngineException(tok, "__CPPCHECK_BAILOUT__"); throw ExprEngineException(tok, "__CPPCHECK_BAILOUT__");
if (Token::simpleMatch(tok, "while (") && (tok->linkAt(1), ") ;") && tok->next()->astOperand1()->hasKnownIntValue() && tok->next()->astOperand1()->getKnownIntValue() == 0) { if (Token::simpleMatch(tok, "while (") && Token::simpleMatch(tok->linkAt(1), ") ;") && tok->next()->astOperand1()->hasKnownIntValue() && tok->next()->astOperand1()->getKnownIntValue() == 0) {
tok = tok->tokAt(4); tok = tok->tokAt(4);
continue; continue;
} }