Explorar el Código

cmGlobalXCodeGenerator: Avoid -Wconditional-uninitialized warning

Clang incorrectly warns about a case where we initialize a variable
inside a condition in such a way that it will always be initialized
before we use it.  Simply initialize the variable when defining it to
silence the warning.
Brad King hace 8 años
padre
commit
20ca9d8f6f
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      Source/cmGlobalXCodeGenerator.cxx

+ 1 - 1
Source/cmGlobalXCodeGenerator.cxx

@@ -176,7 +176,7 @@ cmGlobalGenerator* cmGlobalXCodeGenerator::Factory::CreateGlobalGenerator(
   std::string versionFile;
   {
     std::string out;
-    std::string::size_type pos;
+    std::string::size_type pos = 0;
     if (cmSystemTools::RunSingleCommand("xcode-select --print-path", &out,
                                         nullptr, nullptr, nullptr,
                                         cmSystemTools::OUTPUT_NONE) &&