From e869b44d0fa41f5b7062d169f4d374966f5c2edc Mon Sep 17 00:00:00 2001 From: Moonchild Date: Fri, 10 Nov 2023 10:53:47 +0100 Subject: Issue #2342 - Don't use [[nodiscard]] in C mode in mozalloc. Since both gcc and clang support the internal __attribute__ form, and this is guarded by HAVE_POSIX_MEMALIGN which is not a Windows thing, it's safe to just use that attribute style unconditionally. --- memory/mozalloc/mozalloc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/memory/mozalloc/mozalloc.h b/memory/mozalloc/mozalloc.h index 5448e5a1ee..fca8c35413 100644 --- a/memory/mozalloc/mozalloc.h +++ b/memory/mozalloc/mozalloc.h @@ -87,10 +87,10 @@ MFBT_API char* moz_xstrndup(const char* str, size_t strsize) #if defined(HAVE_POSIX_MEMALIGN) -MFBT_API [[nodiscard]] +MFBT_API __attribute__ ((warn_unused_result)) int moz_xposix_memalign(void **ptr, size_t alignment, size_t size); -MFBT_API [[nodiscard]] +MFBT_API __attribute__ ((warn_unused_result)) int moz_posix_memalign(void **ptr, size_t alignment, size_t size); #endif /* if defined(HAVE_POSIX_MEMALIGN) */ -- cgit v1.2.3