diff options
author | Ed Tanous <edtanous@google.com> | 2022-01-07 20:25:51 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2022-01-12 22:00:37 +0300 |
commit | 46ff87bade273c75f71f940c5770d30e7a29595b (patch) | |
tree | e9c093a73a4cffda570a14e84908e029010a2d2b /redfish-core/lib/log_services.hpp | |
parent | ecd6a3a20ab128ae9d3e356d6250695800dc13be (diff) | |
download | bmcweb-46ff87bade273c75f71f940c5770d30e7a29595b.tar.xz |
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
Diffstat (limited to 'redfish-core/lib/log_services.hpp')
-rw-r--r-- | redfish-core/lib/log_services.hpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp index ddd124bb49..2cd35df428 100644 --- a/redfish-core/lib/log_services.hpp +++ b/redfish-core/lib/log_services.hpp @@ -136,8 +136,10 @@ inline static int getJournalMetadata(sd_journal* journal, 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 @@ inline void requestRoutesPostCodesEntryAdditionalData(App& app) 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"); |