From 83a80c3f7afc01a2c18880cf355e43c5b6e63812 Mon Sep 17 00:00:00 2001 From: Matan Breizman Date: Mon, 26 May 2025 14:26:44 +0000 Subject: [PATCH] src: fix NDEBUG typo _NDEBUG is a typo for NDEBUG. Possibly confused with _DEBUG which is a Visual Studio concept. Include other instances as well in the repo. Fixes: https://tracker.ceph.com/issues/71456 Signed-off-by: Matan Breizman (cherry picked from commit 36569bd2d4280640da4a950d5f5c9e0090c085a5) --- src/crimson/osd/lsan_suppressions.cc | 4 ++-- src/include/function2.hpp | 2 +- src/osd/ReplicatedBackend.cc | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/crimson/osd/lsan_suppressions.cc b/src/crimson/osd/lsan_suppressions.cc index 53b7eb6300d10..3f452587af4b4 100644 --- a/src/crimson/osd/lsan_suppressions.cc +++ b/src/crimson/osd/lsan_suppressions.cc @@ -1,4 +1,4 @@ -#ifndef _NDEBUG +#ifndef NDEBUG // The callbacks we define here will be called from the sanitizer runtime, but // aren't referenced from the Chrome executable. We must ensure that those // callbacks are not sanitizer-instrumented, and that they aren't stripped by @@ -17,4 +17,4 @@ static char kLSanDefaultSuppressions[] = SANITIZER_HOOK_ATTRIBUTE const char *__lsan_default_suppressions() { return kLSanDefaultSuppressions; } -#endif // ! _NDEBUG +#endif // !NDEBUG diff --git a/src/include/function2.hpp b/src/include/function2.hpp index 613e651c73c3c..5419e143496db 100644 --- a/src/include/function2.hpp +++ b/src/include/function2.hpp @@ -756,7 +756,7 @@ class vtable> { // Just swap both pointers if we allocated on the heap to->ptr_ = from->ptr_; -#ifndef _NDEBUG +#ifndef NDEBUG // We don't need to null the pointer since we know that // we don't own the data anymore through the vtable // which is set to empty. diff --git a/src/osd/ReplicatedBackend.cc b/src/osd/ReplicatedBackend.cc index 7e3c1fc956dc4..d4acff869e482 100644 --- a/src/osd/ReplicatedBackend.cc +++ b/src/osd/ReplicatedBackend.cc @@ -728,7 +728,7 @@ static uint32_t crc32_netstring(const uint32_t orig_crc, std::string_view data) auto crc = ceph_crc32c(orig_crc, (unsigned char*)&len, sizeof(len)); crc = ceph_crc32c(crc, (unsigned char*)data.data(), data.length()); -#ifndef _NDEBUG +#ifndef NDEBUG // let's verify the compatibility but, due to performance penalty, // only in debug builds. ceph::bufferlist bl; -- 2.39.5