Skip to content

Commit 338230f

Browse files
chfastaxic
authored andcommitted
Convert no_sanitize attributes to C++ syntax
1 parent f82e808 commit 338230f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/fizzy/execute.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ T fnearest(T value) noexcept
446446
}
447447

448448
template <typename T>
449-
__attribute__((no_sanitize("float-divide-by-zero"))) inline constexpr T fdiv(T a, T b) noexcept
449+
[[gnu::no_sanitize("float-divide-by-zero")]] inline constexpr T fdiv(T a, T b) noexcept
450450
{
451451
static_assert(std::is_floating_point_v<T>);
452452
static_assert(std::numeric_limits<T>::is_iec559);
@@ -500,8 +500,7 @@ inline double fcopysign(double a, double b) noexcept
500500
return bit_cast<double>((a_u & F64AbsMask) | (b_u & F64SignMask));
501501
}
502502

503-
__attribute__((no_sanitize("float-cast-overflow"))) inline constexpr float demote(
504-
double value) noexcept
503+
[[gnu::no_sanitize("float-cast-overflow")]] inline constexpr float demote(double value) noexcept
505504
{
506505
// The float-cast-overflow UBSan check disabled for this conversion. In older clang versions
507506
// (up to 8.0) it reports a failure when non-infinity f64 value is converted to f32 infinity.

0 commit comments

Comments
 (0)