From 20ca9d8f6f4ddd7b56829425950332d972efef11 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 29 Jan 2018 09:21:46 -0500 Subject: 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. --- Source/cmGlobalXCodeGenerator.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 9db21d8..7668fd0 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/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) && -- cgit v0.12