Skip to content

Silence C++23 deprecation warning for numeric_limits<half>::has_denorm#564

Closed
cary-ilm wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
cary-ilm:half-denorm-fix
Closed

Silence C++23 deprecation warning for numeric_limits<half>::has_denorm#564
cary-ilm wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
cary-ilm:half-denorm-fix

Conversation

@cary-ilm
Copy link
Copy Markdown
Member

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

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>
@cary-ilm
Copy link
Copy Markdown
Member Author

Duplicate of #546

@cary-ilm cary-ilm marked this as a duplicate of #546 Apr 16, 2026
@cary-ilm cary-ilm closed this Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant