clang-tidy: Suppress Unused Private Field Warning
The following error was reported during clang-tidy enablement due to
the private field _bus not being used within the DbusActiveRead class.
This fix addresses the issue by marking the _bus field as
[[maybe_unused]], indicating that it might be intentionally unused.
'''
./dbus/dbusactiveread.hpp:32:23: error: private field '_bus' is not used [-Werror
'''
Tested: Build and unit testing verified.
Change-Id: I608e632c60bb33fa18a122e82744e1a57279af35
Signed-off-by: Jayanth Othayoth <ojayanth@gmail.com>
diff --git a/dbus/dbusactiveread.hpp b/dbus/dbusactiveread.hpp
index 2edb3cc..9a80e0e 100644
--- a/dbus/dbusactiveread.hpp
+++ b/dbus/dbusactiveread.hpp
@@ -29,7 +29,9 @@
ReadReturn read(void) override;
private:
- sdbusplus::bus_t& _bus;
+ // Inform the compiler that this variable might not be used,
+ // which suppresses the warning "private field '_bus' is not used"
+ [[maybe_unused]] sdbusplus::bus_t& _bus;
const std::string _path;
const std::string _service; // the sensor service.
std::unique_ptr<DbusHelperInterface> _helper;