Enable reinterpre_cast checks
We seem to use reinterpret cast in a few cases unfortunately. For the
moment, simply ignore most of them, and make it so we don't get more.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ic860cf922576b18cdc8d51d6132f5a9cbcc1d9dc
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp
index ddd124b..2cd35df 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -136,8 +136,10 @@
size_t length = 0;
int ret = 0;
// Get the metadata from the requested field of the journal entry
- ret = sd_journal_get_data(journal, field.data(),
- reinterpret_cast<const void**>(&data), &length);
+ // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
+ const void** dataVoid = reinterpret_cast<const void**>(&data);
+
+ ret = sd_journal_get_data(journal, field.data(), dataVoid, &length);
if (ret < 0)
{
return ret;
@@ -3462,18 +3464,17 @@
return;
}
- auto& [tID, code] = postcodes[value];
- if (code.empty())
+ auto& [tID, c] = postcodes[value];
+ if (c.empty())
{
BMCWEB_LOG_INFO << "No found post code data";
messages::resourceNotFound(asyncResp->res,
"LogEntry", postCodeID);
return;
}
-
- std::string_view strData(
- reinterpret_cast<const char*>(code.data()),
- code.size());
+ // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
+ const char* d = reinterpret_cast<const char*>(c.data());
+ std::string_view strData(d, c.size());
asyncResp->res.addHeader("Content-Type",
"application/octet-stream");