Silence C++23 deprecation warning for numeric_limits<half>::has_denorm#564
Closed
cary-ilm wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
Closed
Silence C++23 deprecation warning for numeric_limits<half>::has_denorm#564cary-ilm wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
cary-ilm wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
Conversation
In C++23, the type `float_denorm_style` and enumerator value `has_denorm` are deprecated but not yet replaced, but are still required by numeric_limits. This yields the warning: src/Imath/half.h:948:22: warning: 'float_denorm_style' is deprecated [-Wdeprecated-declarations] static constexpr float_denorm_style has_denorm = denorm_present; C++23 (P2614R2) deprecates the type `std::float_denorm_style`, and the `numeric_limits` members that use it (`has_denorm`, `has_denorm_loss`) but does not yet provide a replacement, so the warning can't be avoided. So silence it with a #pragma. This also adds an informational message at configuration time reporting the C++ standard: -- Building against C++ Standard: 23 Assisted by: Cursor Signed-off-by: Cary Phillips <cary@ilm.com>
Member
Author
|
Duplicate of #546 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In C++23, the type
float_denorm_styleand enumerator valuehas_denormare deprecated but not yet replaced, but are still required by numeric_limits. This yields the warning:C++23 (P2614R2) deprecates the type
std::float_denorm_style, and thenumeric_limitsmembers that use it (has_denorm,has_denorm_loss) but does not yet provide a replacement, so the warning can't be avoided. So silence it with a #pragma.This also adds an informational message at configuration time reporting the C++ standard:
-- Building against C++ Standard: 23Assisted by: Cursor