Sfoglia il codice sorgente

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.
Brad King 6 anni fa
parent
commit
c3203bf316
1 ha cambiato i file con 3 aggiunte e 2 eliminazioni
  1. 3 2
      Source/cmListFileCache.cxx

+ 3 - 2
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;