Suppress clang-tidy warning for C++20
clang-tidy-11 -p=build-clang src/ExternalSensor.cpp
./src/ExternalSensor.cpp:148:29: error: use nullptr [modernize-use-nullptr,-warnings-as-errors]
return (ageElapsed(now) < writeTimeout);
^
nullptr
clang-tidy-11 -p=build-clang src/CPUSensorMain.cpp
./src/CPUSensorMain.cpp:80:22: error: use nullptr [modernize-use-nullptr,-warnings-as-errors]
return (name < rhs.name);
^
nullptr
These are false positives fixed by:
https://reviews.llvm.org/D95714?id=320393
For now, suppress the lint.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: Ie839608819681476ba3c22201aeaaba7c22e4c05
diff --git a/src/CPUSensorMain.cpp b/src/CPUSensorMain.cpp
index 6106bc0..b36e6ad 100644
--- a/src/CPUSensorMain.cpp
+++ b/src/CPUSensorMain.cpp
@@ -77,6 +77,7 @@
bool operator<(const CPUConfig& rhs) const
{
+ // NOLINTNEXTLINE
return (name < rhs.name);
}
};
diff --git a/src/ExternalSensor.cpp b/src/ExternalSensor.cpp
index 91f488b..22f5058 100644
--- a/src/ExternalSensor.cpp
+++ b/src/ExternalSensor.cpp
@@ -145,6 +145,7 @@
}
// If age, as of now, is less than timeout, it is deemed fresh
+ // NOLINTNEXTLINE
return (ageElapsed(now) < writeTimeout);
}