Skip to content

Commit

Permalink
Avoid C++23 deprecation warnings from float_denorm_style
Browse files Browse the repository at this point in the history
this change fixes errors emitted by MS compiler:
```
1>C:\abseil-cpp\absl\numeric\int128.h(278,20): error C4996: 'std::float_denorm_style': warning STL4042: std::float_denorm_style, std::numeric_limits::has_denorm, and std::numeric_limits::has_denorm_loss are deprecated in C++23. You can define _SILENCE_CXX23_DENORM_DEPRECATION_WARNING or _SILENCE_ALL_CXX23_DEPRECATION_WARNINGS to suppress this warning.
```
  • Loading branch information
pps83 committed Apr 17, 2024
1 parent fa57bfc commit 7be9635
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions absl/numeric/int128.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,9 @@ class numeric_limits<absl::uint128> {
static constexpr bool has_infinity = false;
static constexpr bool has_quiet_NaN = false;
static constexpr bool has_signaling_NaN = false;
ABSL_INTERNAL_DISABLE_DEPRECATED_DECLARATION_WARNING
static constexpr float_denorm_style has_denorm = denorm_absent;
ABSL_INTERNAL_RESTORE_DEPRECATED_DECLARATION_WARNING
static constexpr bool has_denorm_loss = false;
static constexpr float_round_style round_style = round_toward_zero;
static constexpr bool is_iec559 = false;
Expand Down Expand Up @@ -512,7 +514,9 @@ class numeric_limits<absl::int128> {
static constexpr bool has_infinity = false;
static constexpr bool has_quiet_NaN = false;
static constexpr bool has_signaling_NaN = false;
ABSL_INTERNAL_DISABLE_DEPRECATED_DECLARATION_WARNING
static constexpr float_denorm_style has_denorm = denorm_absent;
ABSL_INTERNAL_RESTORE_DEPRECATED_DECLARATION_WARNING
static constexpr bool has_denorm_loss = false;
static constexpr float_round_style round_style = round_toward_zero;
static constexpr bool is_iec559 = false;
Expand Down

0 comments on commit 7be9635

Please sign in to comment.