Enable cppcoreguidelines-init-variables
We try to enforce this rule, but clearly the robot can do a better job.
Enable the rule, and for init of all variables that clang-tidy finds in
error.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Icf64bc51b3180de29f7e92fa5c5f636e6b1462a6
diff --git a/src/CPUSensor.cpp b/src/CPUSensor.cpp
index d57d565..078d790 100644
--- a/src/CPUSensor.cpp
+++ b/src/CPUSensor.cpp
@@ -43,20 +43,19 @@
Sensor(escapeName(sensorName), std::move(thresholdsIn), sensorConfiguration,
objectType, false, false, 0, 0, conn, PowerState::on),
std::enable_shared_from_this<CPUSensor>(), objServer(objectServer),
- inputDev(io), waitTimer(io), path(path),
+ inputDev(io), waitTimer(io),
+ nameTcontrol("Tcontrol CPU" + std::to_string(cpuId)), path(path),
privTcontrol(std::numeric_limits<double>::quiet_NaN()),
dtsOffset(dtsOffset), show(show), pollTime(CPUSensor::sensorPollMs),
minMaxReadCounter(0)
{
- nameTcontrol = labelTcontrol;
- nameTcontrol += " CPU" + std::to_string(cpuId);
if (show)
{
if (auto fileParts = splitFileName(path))
{
auto& [type, nr, item] = *fileParts;
std::string interfacePath;
- const char* units;
+ const char* units = nullptr;
if (type.compare("power") == 0)
{
interfacePath = "/xyz/openbmc_project/sensors/power/" + name;