boostorg / multiprecision

Boost.Multiprecision
Boost Software License 1.0
194 stars 111 forks source link

Add macro to disable MSVC has_denorm deprecation warning #574

Closed mborland closed 9 months ago

mborland commented 9 months ago

Closes: #573

jzmaddock commented 9 months ago

Are we between a rock and a hard place here? The problem with _SILENCE_CXX23_DENORM_DEPRECATION_WARNING is that it changes the std lib header and silences the warning everywhere including in user code. We may also eventually have this issue with other std lib's as well.

I wonder what the correct thing to do is here, members like has_denorm is still required to be present in C++23 but is "a candidate for removal" in a later std. So we do need to define those members even in C++23 :( I wonder if there any #pragma warning(disable:XXXX) that would work in this case?

mborland commented 9 months ago

Are we between a rock and a hard place here? The problem with _SILENCE_CXX23_DENORM_DEPRECATION_WARNING is that it changes the std lib header and silences the warning everywhere including in user code. We may also eventually have this issue with other std lib's as well.

I wonder what the correct thing to do is here, members like has_denorm is still required to be present in C++23 but is "a candidate for removal" in a later std. So we do need to define those members even in C++23 :( I wonder if there any #pragma warning(disable:XXXX) that would work in this case?

We are between a rock and a hard place. I tried disabling the warning, and it still propagates: https://godbolt.org/z/bz1a54jf7

jzmaddock commented 9 months ago

Shucks :(

The macro doesn't work either if has already been included: https://godbolt.org/z/r6Pdn71We

jzmaddock commented 9 months ago

The #pragma does seem to work in some situations and not others... will experiment.

jzmaddock commented 9 months ago

This seems to get it: https://github.com/boostorg/multiprecision/pull/575