From e4e85c5b2d666165bb5dad4e01a78ef72dcb1481 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 5 Oct 2020 14:39:37 +0200 Subject: cmake: Fix uninitialized member in HandleDeleteCacheVariables If there is no existing value, mark the saved entry as UNINITIALIZED (avoids compiler warning about uninitialized type). Issue: #21166 --- Source/cmake.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/cmake.cxx b/Source/cmake.cxx index dc06fae..d9c6b7a 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1409,6 +1409,8 @@ int cmake::HandleDeleteCacheVariables(const std::string& var) this->State->GetCacheEntryProperty(save.key, "HELPSTRING")) { save.help = *help; } + } else { + save.type = cmStateEnums::CacheEntryType::UNINITIALIZED; } saved.push_back(std::move(save)); } -- cgit v0.12 From c27553afb2013d83b90a71ca7940643da01b20d4 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 5 Oct 2020 14:44:13 +0200 Subject: cmCTestBuildHandler: Avoid uninitialized line-numbers When commands fail, there is no line number to report; still initialize it explicitly to avoid compiler warnings. Issue: #21166 --- Source/CTest/cmCTestBuildHandler.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx index bb700eba..103dc1e 100644 --- a/Source/CTest/cmCTestBuildHandler.cxx +++ b/Source/CTest/cmCTestBuildHandler.cxx @@ -901,6 +901,7 @@ int cmCTestBuildHandler::RunMakeCommand(const std::string& command, reporter.WriteXML(); } else { cmCTestBuildErrorWarning errorwarning; + errorwarning.LineNumber = 0; errorwarning.LogLine = 1; errorwarning.Text = cmStrCat( "*** WARNING non-zero return value in ctest from: ", argv[0]); @@ -925,6 +926,7 @@ int cmCTestBuildHandler::RunMakeCommand(const std::string& command, } else if (result == cmsysProcess_State_Error) { // If there was an error running command, report that on the dashboard. cmCTestBuildErrorWarning errorwarning; + errorwarning.LineNumber = 0; errorwarning.LogLine = 1; errorwarning.Text = cmStrCat("*** ERROR executing: ", cmsysProcess_GetErrorString(cp)); -- cgit v0.12