diff options
author | Brad King <brad.king@kitware.com> | 2019-01-23 18:20:14 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-01-23 18:20:14 (GMT) |
commit | c3203bf31637a960d1bf579fb7092a1ae850cdb5 (patch) | |
tree | 7d5443d3d2f354d4b6e2ba83da93860e09c6a34b | |
parent | 68eabb357616f7ef469b20dd8d9cb8ce588e113d (diff) | |
download | CMake-c3203bf31637a960d1bf579fb7092a1ae850cdb5.zip CMake-c3203bf31637a960d1bf579fb7092a1ae850cdb5.tar.gz CMake-c3203bf31637a960d1bf579fb7092a1ae850cdb5.tar.bz2 |
Silence -Wcomma warning
We use a comma-in-paren expression to evaluate multiple statements
in a condition. Clang warns that this may be incorrect. Follow
its suggestion to cast all but the last expression to `void` to
silence the warning.
-rw-r--r-- | Source/cmListFileCache.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx index ff793f6..cc2c09f 100644 --- a/Source/cmListFileCache.cxx +++ b/Source/cmListFileCache.cxx @@ -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; |