From 70cf23a7e366dbaa29f6c9010f2eac60ed700d20 Mon Sep 17 00:00:00 2001 From: Neargye Date: Fri, 13 Dec 2019 11:19:21 +0500 Subject: [PATCH] suppress specific warnings --- include/magic_enum.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/magic_enum.hpp b/include/magic_enum.hpp index b620fbc..c917952 100644 --- a/include/magic_enum.hpp +++ b/include/magic_enum.hpp @@ -43,6 +43,12 @@ #include #include +#if defined(_MSC_VER) +# pragma warning(push) +# pragma warning(disable : 26495) // Variable 'magic_enum::detail::static_string::chars' is uninitialized. +# pragma warning(disable : 26451) // Arithmetic overflow: 'indexes[static_cast(value) - min_v]' using operator '-' on a 4 byte value and then casting the result to a 8 byte value. +#endif + // Checks magic_enum compiler compatibility. #if defined(__clang__) || defined(__GNUC__) && __GNUC__>= 9 || defined(_MSC_VER) # undef MAGIC_ENUM_SUPPORTED @@ -596,4 +602,8 @@ constexpr auto operator^=(E& lhs, E rhs) noexcept -> detail::enable_if_enum_t