From b886cfadff9f7f33e4b61232577950ca3b94d81a Mon Sep 17 00:00:00 2001 From: Moonchild Date: Fri, 13 Oct 2023 23:12:00 +0200 Subject: Issue #2281 - Mark mozalloc new() as noexcept to aligh with what the VC runtime expects. Currently spams warnings but may actually error out if not fixed, or result in undefined behaviour if mismatching signatures are treated as redeclarations with different exception specifications. --- memory/mozalloc/mozalloc.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/memory/mozalloc/mozalloc.h b/memory/mozalloc/mozalloc.h index de8c549b31..8c224472c4 100644 --- a/memory/mozalloc/mozalloc.h +++ b/memory/mozalloc/mozalloc.h @@ -152,14 +152,11 @@ MFBT_API void* moz_xvalloc(size_t size) #if defined(_MSC_VER) /* - * Suppress build warning spam (bug 578546). + * Suppress build warning spam (issue #2281). */ -#define MOZALLOC_THROW_IF_HAS_EXCEPTIONS -#define MOZALLOC_THROW_BAD_ALLOC_IF_HAS_EXCEPTIONS +#define MOZALLOC_THROW_IF_HAS_EXCEPTIONS noexcept(true) +#define MOZALLOC_THROW_BAD_ALLOC_IF_HAS_EXCEPTIONS noexcept(false) #elif __cplusplus >= 201103 -/* - * C++11 has deprecated exception-specifications in favour of |noexcept|. - */ #define MOZALLOC_THROW_IF_HAS_EXCEPTIONS noexcept(true) #define MOZALLOC_THROW_BAD_ALLOC_IF_HAS_EXCEPTIONS noexcept(false) #else -- cgit v1.2.3