Skip to content

Commit 7f19e0e

Browse files
chfastaxic
authored andcommitted
Convert no_sanitize attributes to C++ syntax
1 parent 53f827e commit 7f19e0e

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
@@ -459,7 +459,7 @@ T fnearest(T value) noexcept
459459
}
460460

461461
template <typename T>
462-
__attribute__((no_sanitize("float-divide-by-zero"))) inline constexpr T fdiv(T a, T b) noexcept
462+
[[gnu::no_sanitize("float-divide-by-zero")]] inline constexpr T fdiv(T a, T b) noexcept
463463
{
464464
static_assert(std::is_floating_point_v<T>);
465465
static_assert(std::numeric_limits<T>::is_iec559);
@@ -495,8 +495,7 @@ inline T fmax(T a, T b) noexcept
495495
}
496496

497497

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

0 commit comments

Comments
 (0)