summaryrefslogtreecommitdiff
path: root/parser_st.c
diff options
context:
space:
mode:
authorjinroq <2787780+jinroq@users.noreply.github.com>2023-06-29 11:44:54 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-07-01 23:16:54 +0900
commita70320b8cd2c8590fb01607cca354a9bc57dde0a (patch)
tree4e5e83881d71153f38f1b3a0ba3c60bae161c889 /parser_st.c
parent174dbe33cc183e48897e8819ad694b0b44642a9f (diff)
Define `NO_SANITIZE` with reference to ext/bigdecimal/missing.c
Diffstat (limited to 'parser_st.c')
-rw-r--r--parser_st.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/parser_st.c b/parser_st.c
index 5d3148bc0d..c7a45d25e6 100644
--- a/parser_st.c
+++ b/parser_st.c
@@ -146,6 +146,16 @@ nonempty_memcpy(void *dest, const void *src, size_t n)
#undef st_locale_insensitive_strncasecmp
#define st_locale_insensitive_strncasecmp rb_parser_st_locale_insensitive_strncasecmp
+#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
+
#ifndef NO_SANITIZE
# define NO_SANITIZE(x, y) y
#endif