Skip to content

Commit

Permalink
Convert no_sanitize attributes to C++ syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast authored and axic committed May 21, 2022
1 parent beaf5e3 commit 9040d68
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/fizzy/execute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ T fnearest(T value) noexcept
}

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

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

0 comments on commit 9040d68

Please sign in to comment.