From 48b254a4bc586004258ce5e31cf9ca0cbcc262f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20S=C3=A1nchez?= Date: Mon, 23 Oct 2023 17:56:04 +0000 Subject: [PATCH] Disable denorm deprecation warnings in MSVC C++23. --- Eigen/src/Core/util/DisableStupidWarnings.h | 5 +++++ Eigen/src/Core/util/ReenableStupidWarnings.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/Eigen/src/Core/util/DisableStupidWarnings.h b/Eigen/src/Core/util/DisableStupidWarnings.h index bed6cddf8..7d1766c24 100644 --- a/Eigen/src/Core/util/DisableStupidWarnings.h +++ b/Eigen/src/Core/util/DisableStupidWarnings.h @@ -21,6 +21,11 @@ #pragma warning( push ) #endif #pragma warning( disable : 4100 4101 4127 4181 4211 4244 4273 4324 4503 4512 4522 4700 4714 4717 4800) + // We currently rely on has_denorm in tests, and need it defined correctly for half/bfloat16. + #ifndef _SILENCE_CXX23_DENORM_DEPRECATION_WARNING + #define EIGEN_REENABLE_CXX23_DENORM_DEPRECATION_WARNING 1 + #define _SILENCE_CXX23_DENORM_DEPRECATION_WARNING + #endif #elif defined __INTEL_COMPILER // 2196 - routine is both "inline" and "noinline" ("noinline" assumed) diff --git a/Eigen/src/Core/util/ReenableStupidWarnings.h b/Eigen/src/Core/util/ReenableStupidWarnings.h index 7021e6d3c..c8238de84 100644 --- a/Eigen/src/Core/util/ReenableStupidWarnings.h +++ b/Eigen/src/Core/util/ReenableStupidWarnings.h @@ -8,6 +8,11 @@ #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS #ifdef _MSC_VER #pragma warning( pop ) + #ifdef EIGEN_REENABLE_CXX23_DENORM_DEPRECATION_WARNING + #undef EIGEN_REENABLE_CXX23_DENORM_DEPRECATION_WARNING + #undef _SILENCE_CXX23_DENORM_DEPRECATION_WARNING + #endif + #elif defined __INTEL_COMPILER #pragma warning pop #elif defined __clang__