summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
authorAdriaan de Groot <groot@kde.org>2020-10-05 12:39:37 (GMT)
committerBrad King <brad.king@kitware.com>2020-10-05 13:13:18 (GMT)
commite4e85c5b2d666165bb5dad4e01a78ef72dcb1481 (patch)
treefe99d17bcee2a177bdc67743d0c3668cd37f4506 /Source/cmake.cxx
parentb1898bf97570b2887f7398105231ff72adb1564d (diff)
downloadCMake-e4e85c5b2d666165bb5dad4e01a78ef72dcb1481.zip
CMake-e4e85c5b2d666165bb5dad4e01a78ef72dcb1481.tar.gz
CMake-e4e85c5b2d666165bb5dad4e01a78ef72dcb1481.tar.bz2
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
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r--Source/cmake.cxx2
1 files changed, 2 insertions, 0 deletions
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));
}