diff options
author | Ed Tanous <edtanous@google.com> | 2022-01-07 20:28:45 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2022-01-12 22:00:37 +0300 |
commit | ca45aa3c416e55027b8d17078bac6493e81d564f (patch) | |
tree | 6b23f35cfba77f66557e78230b85684cef0f5c04 /include/ibm/locks.hpp | |
parent | 46ff87bade273c75f71f940c5770d30e7a29595b (diff) | |
download | bmcweb-ca45aa3c416e55027b8d17078bac6493e81d564f.tar.xz |
Enable checks for pointer arithmetic
Quite a few places we've disobeyed this rule, so simply ignore them for
now to avoid new issues popping up.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I3e518a8e8742279afb3ad1a9dad54006ed109fb1
Diffstat (limited to 'include/ibm/locks.hpp')
-rw-r--r-- | include/ibm/locks.hpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/include/ibm/locks.hpp b/include/ibm/locks.hpp index 4fbb50360d..5a86d09dec 100644 --- a/include/ibm/locks.hpp +++ b/include/ibm/locks.hpp @@ -535,9 +535,14 @@ inline bool Lock::checkByte(uint64_t resourceId1, uint64_t resourceId2, // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) uint8_t* q = reinterpret_cast<uint8_t*>(&resourceId2); - BMCWEB_LOG_DEBUG << "Comparing bytes " << std::to_string(p[position]) << "," - << std::to_string(q[position]); - if (p[position] != q[position]) + // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) + uint8_t pPosition = p[position]; + // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) + uint8_t qPosition = q[position]; + + BMCWEB_LOG_DEBUG << "Comparing bytes " << std::to_string(pPosition) << "," + << std::to_string(qPosition); + if (pPosition != qPosition) { return false; } |