Skip to content

Commit b49e140

Browse files
committed
Convert no_sanitize attributes to C++ syntax
1 parent 713e447 commit b49e140

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/fizzy/execute.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ T fnearest(T value) noexcept
390390
}
391391

392392
template <typename T>
393-
__attribute__((no_sanitize("float-divide-by-zero"))) inline constexpr T fdiv(T a, T b) noexcept
393+
[[gnu::no_sanitize("float-divide-by-zero")]] inline constexpr T fdiv(T a, T b) noexcept
394394
{
395395
static_assert(std::is_floating_point_v<T>);
396396
static_assert(std::numeric_limits<T>::is_iec559);
@@ -444,8 +444,7 @@ inline double fcopysign(double a, double b) noexcept
444444
return bit_cast<double>((a_u & F64AbsMask) | (b_u & F64SignMask));
445445
}
446446

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

0 commit comments

Comments
 (0)