Enable init checker
clang-tidy added cppcoreguidelines-init-variables as a check, which is
something we already enforce to some extent, but getting CI to enforce
it will help reviews move faster.
Tested: Code compiles. Noop changes.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I7e10950de617b1d3262265572b1703f2e60b69d0
diff --git a/redfish-core/lib/ethernet.hpp b/redfish-core/lib/ethernet.hpp
index 8735178..ee8d2cd 100644
--- a/redfish-core/lib/ethernet.hpp
+++ b/redfish-core/lib/ethernet.hpp
@@ -635,9 +635,9 @@
*bits = 0;
}
- char* endPtr;
+ char* endPtr = nullptr;
long previousValue = 255;
- bool firstZeroInByteHit;
+ bool firstZeroInByteHit = false;
for (const std::string& byte : bytesInMask)
{
if (byte.empty())
@@ -1581,8 +1581,8 @@
return;
}
- const std::string* addr;
- uint8_t prefix;
+ const std::string* addr = nullptr;
+ uint8_t prefix = 0;
// Find the address and prefixLength values. Any values that are
// not explicitly provided are assumed to be unmodified from the