From 7f9e61fb3c549c7324698a79b0ad3b2c987cec42 Mon Sep 17 00:00:00 2001 From: Dhruvaraj Subhashchandran Date: Thu, 24 Aug 2023 02:20:20 -0500 Subject: [PATCH 1/2] Removed unwanted std::move operations There were couple of std::move operations were unwanted and that was giving warning with C++ 23, removing those Signed-off-by: Dhruvaraj Subhashchandran --- dump_offload_main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dump_offload_main.cpp b/dump_offload_main.cpp index c9e9bf48..9b81893b 100644 --- a/dump_offload_main.cpp +++ b/dump_offload_main.cpp @@ -15,20 +15,20 @@ int main(int argc, char** argv) // Read arguments. auto options = phosphor::dump::util::ArgumentParser(argc, argv); - std::string idStr = std::move((options)["id"]); + std::string idStr = (options)["id"]; if (idStr.empty()) { ExitWithError("Dump id is not provided", argv); } auto id = std::stoi(idStr); - std::filesystem::path path = std::move((options)["path"]); + std::filesystem::path path = (options)["path"]; if (path.empty()) { ExitWithError("Dump file path not specified.", argv); } - std::string uri = std::move((options)["uri"]); + std::string uri = (options)["uri"]; if (path.empty()) { ExitWithError("Dump offload uri not specified.", argv); From c76261e339ba512d09f1048e4561e733b9f65cbd Mon Sep 17 00:00:00 2001 From: Dhruvaraj Subhashchandran Date: Thu, 24 Aug 2023 04:00:18 -0500 Subject: [PATCH 2/2] Add check in the variant read Signed-off-by: Dhruvaraj Subhashchandran --- dump_utils.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dump_utils.cpp b/dump_utils.cpp index d055e670..f9a7c30d 100644 --- a/dump_utils.cpp +++ b/dump_utils.cpp @@ -97,7 +97,10 @@ std::string getStateValue(const std::string& intf, const std::string& objPath, reply.read(propertyVal); - stateVal = std::get(propertyVal); + if (std::holds_alternative(propertyVal)) + { + stateVal = std::get(propertyVal); + } } catch (const sdbusplus::exception_t& e) {