Skip to content

Commit 9040d68

Browse files
chfastaxic
authored andcommitted
Convert no_sanitize attributes to C++ syntax
1 parent beaf5e3 commit 9040d68

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
@@ -426,7 +426,7 @@ T fnearest(T value) noexcept
426426
}
427427

428428
template <typename T>
429-
__attribute__((no_sanitize("float-divide-by-zero"))) inline constexpr T fdiv(T a, T b) noexcept
429+
[[gnu::no_sanitize("float-divide-by-zero")]] inline constexpr T fdiv(T a, T b) noexcept
430430
{
431431
static_assert(std::is_floating_point_v<T>);
432432
static_assert(std::numeric_limits<T>::is_iec559);
@@ -480,8 +480,7 @@ inline double fcopysign(double a, double b) noexcept
480480
return bit_cast<double>((a_u & F64AbsMask) | (b_u & F64SignMask));
481481
}
482482

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

0 commit comments

Comments
 (0)