Make dbus-sensors compile with clang-13
clang-13 finds a lot more warnings for unused variables than it used to,
and also picks up some warnings about errant std::moves that are in
place.
This commit fixes them.
Tested:
code compiles against clang-13
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I80864287b7131acfe936c4b28afaf34ababb3029
diff --git a/src/IntrusionSensorMain.cpp b/src/IntrusionSensorMain.cpp
index 154b2b2..ad4794a 100644
--- a/src/IntrusionSensorMain.cpp
+++ b/src/IntrusionSensorMain.cpp
@@ -183,8 +183,7 @@
const std::shared_ptr<sdbusplus::asio::connection>& dbusConnection)
{
auto getter = std::make_shared<GetSensorConfiguration>(
- dbusConnection,
- std::move([](const ManagedObjectType& sensorConfigurations) {
+ dbusConnection, [](const ManagedObjectType& sensorConfigurations) {
// Get NIC name and save to map
lanInfoMap.clear();
for (const std::pair<sdbusplus::message::object_path, SensorData>&
@@ -228,7 +227,7 @@
{
std::cerr << "can't find matched NIC name. \n";
}
- }));
+ });
getter->getConfiguration(
std::vector<std::string>{nicTypes.begin(), nicTypes.end()});