ruby-changes:64872
From: Kenta <ko1@a...>
Date: Thu, 14 Jan 2021 11:01:53 +0900 (JST)
Subject: [ruby-changes:64872] e129be7592 (master): [ruby/bigdecimal] Suppress warning at NO_SANITIZE on gcc
https://git.ruby-lang.org/ruby.git/commit/?id=e129be7592 From e129be7592cd0551f45f6c6aa2faf88bbe697f66 Mon Sep 17 00:00:00 2001 From: Kenta Murata <mrkn@m...> Date: Thu, 14 Jan 2021 09:23:03 +0900 Subject: [ruby/bigdecimal] Suppress warning at NO_SANITIZE on gcc https://github.com/ruby/bigdecimal/commit/f6765b8071 diff --git a/ext/bigdecimal/missing.c b/ext/bigdecimal/missing.c index b0bc6ee..703232d 100644 --- a/ext/bigdecimal/missing.c +++ b/ext/bigdecimal/missing.c @@ -8,6 +8,16 @@ https://github.com/ruby/ruby/blob/trunk/ext/bigdecimal/missing.c#L8 # define ATOMIC_PTR_CAS(var, old, new) RUBY_ATOMIC_PTR_CAS(var, old, new) #endif +#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) +/* GCC warns about unknown sanitizer, which is annoying. */ +# undef NO_SANITIZE +# define NO_SANITIZE(x, y) \ + _Pragma("GCC diagnostic push") \ + _Pragma("GCC diagnostic ignored \"-Wattributes\"") \ + __attribute__((__no_sanitize__(x))) y; \ + _Pragma("GCC diagnostic pop") +#endif + #undef strtod #define strtod BigDecimal_strtod #undef dtoa -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/