summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenta Murata <mrkn@mrkn.jp>2021-01-14 09:23:03 +0900
committerKenta Murata <mrkn@mrkn.jp>2021-01-14 10:20:30 +0900
commite129be7592cd0551f45f6c6aa2faf88bbe697f66 (patch)
treea1625eea38c9f4d9678f7189da8a3b7926091ce1
parentefcdf68e6443ab70fbff1703b9dabbfc5090df31 (diff)
[ruby/bigdecimal] Suppress warning at NO_SANITIZE on gcc
https://github.com/ruby/bigdecimal/commit/f6765b8071
-rw-r--r--ext/bigdecimal/missing.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ext/bigdecimal/missing.c b/ext/bigdecimal/missing.c
index b0bc6eea4eb..703232d92f7 100644
--- a/ext/bigdecimal/missing.c
+++ b/ext/bigdecimal/missing.c
@@ -8,6 +8,16 @@
# 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