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.
This commit is contained in:
Brad King
2018-01-29 09:21:46 -05:00
parent 92cd3d0677
commit 20ca9d8f6f

View File

@@ -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) &&