fixups for clang-20
This avoids -Werror=maybe-uninitialized
Tested: Unit Tests Pass
Change-Id: I9d9f953550675b4929cd069c82794a76c05f5bd6
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
Signed-off-by: Jagpal Singh Gill <paligill@gmail.com>
diff --git a/bmc/item_updater.cpp b/bmc/item_updater.cpp
index 2e889fb..77c9a70 100644
--- a/bmc/item_updater.cpp
+++ b/bmc/item_updater.cpp
@@ -493,6 +493,7 @@
auto it = versions.find(entryId);
if (it != versions.end())
{
+ // NOLINTNEXTLINE(misc-redundant-expression)
if (it->second->isFunctional() && ACTIVE_BMC_MAX_ALLOWED > 1)
{
error(
diff --git a/bmc/item_updater_helper.hpp b/bmc/item_updater_helper.hpp
index 2b10e8f..b90f498 100644
--- a/bmc/item_updater_helper.hpp
+++ b/bmc/item_updater_helper.hpp
@@ -66,7 +66,7 @@
private:
/** @brief Persistent sdbusplus D-Bus bus connection. */
- sdbusplus::bus_t& bus;
+ [[maybe_unused]] sdbusplus::bus_t& bus;
};
} // namespace updater
diff --git a/eeprom-device/eeprom_device.cpp b/eeprom-device/eeprom_device.cpp
index 86f59d9..277c84e 100644
--- a/eeprom-device/eeprom_device.cpp
+++ b/eeprom-device/eeprom_device.cpp
@@ -121,9 +121,15 @@
{
close(pipefd[1]);
- sdbusplus::async::fdio pipe_fdio(ctx, pipefd[0]);
+ auto fdio = std::make_unique<sdbusplus::async::fdio>(ctx, pipefd[0]);
+ if (!fdio)
+ {
+ perror("fdio creation failed");
+ close(pipefd[0]);
+ co_return -1;
+ }
- co_await pipe_fdio.next();
+ co_await fdio->next();
int status;
waitpid(pid, &status, 0);
@@ -440,10 +446,10 @@
while (!ctx.stop_requested())
{
- auto [interfaceName, changedProperties] =
- co_await hostPower.stateChangedMatch
- .next<std::string,
- std::map<std::string, std::variant<std::string>>>();
+ auto nextResult = co_await hostPower.stateChangedMatch.next<
+ std::string, std::map<std::string, std::variant<std::string>>>();
+
+ auto [interfaceName, changedProperties] = nextResult;
auto it = changedProperties.find("CurrentHostState");
if (it != changedProperties.end())
diff --git a/i2c-vr/xdpe1x2xx/xdpe1x2xx.hpp b/i2c-vr/xdpe1x2xx/xdpe1x2xx.hpp
index 53fdcf1..dfe3d47 100644
--- a/i2c-vr/xdpe1x2xx/xdpe1x2xx.hpp
+++ b/i2c-vr/xdpe1x2xx/xdpe1x2xx.hpp
@@ -59,7 +59,6 @@
phosphor::i2c::I2C i2cInterface;
- uint8_t Id;
struct xdpe1x2xxConfig configuration;
};