Merge topic 'clang-warnings'

c3203bf316 Silence -Wcomma warning
68eabb3576 Avoid -Wstring-plus-int warning

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2846
This commit is contained in:
Brad King
2019-01-25 13:04:13 +00:00
committed by Kitware Robot
2 changed files with 5 additions and 4 deletions

View File

@@ -193,8 +193,9 @@ bool cmListFileParser::ParseFunction(const char* name, long line)
unsigned long lastLine;
unsigned long parenDepth = 0;
this->Separation = SeparationOkay;
while ((lastLine = cmListFileLexer_GetCurrentLine(this->Lexer),
token = cmListFileLexer_Scan(this->Lexer))) {
while (
(static_cast<void>(lastLine = cmListFileLexer_GetCurrentLine(this->Lexer)),
token = cmListFileLexer_Scan(this->Lexer))) {
if (token->type == cmListFileLexer_Token_Space ||
token->type == cmListFileLexer_Token_Newline) {
this->Separation = SeparationOkay;

View File

@@ -545,10 +545,10 @@ const char* cmState::GetGlobalProperty(const std::string& prop)
}
#define STRING_LIST_ELEMENT(F) ";" #F
if (prop == "CMAKE_C_KNOWN_FEATURES") {
return FOR_EACH_C_FEATURE(STRING_LIST_ELEMENT) + 1;
return &FOR_EACH_C_FEATURE(STRING_LIST_ELEMENT)[1];
}
if (prop == "CMAKE_CXX_KNOWN_FEATURES") {
return FOR_EACH_CXX_FEATURE(STRING_LIST_ELEMENT) + 1;
return &FOR_EACH_CXX_FEATURE(STRING_LIST_ELEMENT)[1];
}
#undef STRING_LIST_ELEMENT
return this->GlobalProperties.GetPropertyValue(prop);