Преглед изворни кода

cmSystemTools: Restore unreachable return to silence warnings

Some compilers do not recognize that the end of copy_data cannot
be reached and complain that there is no return statement.  Clang
warns that there is an unreachable return statement if it appears.
Conditionally add the return statement when not building with Clang.
Brad King пре 11 година
родитељ
комит
1de086855c
1 измењених фајлова са 3 додато и 0 уклоњено
  1. 3 0
      Source/cmSystemTools.cxx

+ 3 - 0
Source/cmSystemTools.cxx

@@ -1662,6 +1662,9 @@ long copy_data(struct archive *ar, struct archive *aw)
       return (r);
       return (r);
       }
       }
     }
     }
+#if !defined(__clang__)
+  return r; /* this should not happen but it silences a warning */
+#endif
 }
 }
 
 
 bool extract_tar(const char* outFileName, bool verbose,
 bool extract_tar(const char* outFileName, bool verbose,