Skip to content

Commit f6765b8

Browse files
committed
Suppress warning at NO_SANITIZE on gcc
1 parent af6502c commit f6765b8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

ext/bigdecimal/missing.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@
88
# define ATOMIC_PTR_CAS(var, old, new) RUBY_ATOMIC_PTR_CAS(var, old, new)
99
#endif
1010

11+
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
12+
/* GCC warns about unknown sanitizer, which is annoying. */
13+
# undef NO_SANITIZE
14+
# define NO_SANITIZE(x, y) \
15+
_Pragma("GCC diagnostic push") \
16+
_Pragma("GCC diagnostic ignored \"-Wattributes\"") \
17+
__attribute__((__no_sanitize__(x))) y; \
18+
_Pragma("GCC diagnostic pop")
19+
#endif
20+
1121
#undef strtod
1222
#define strtod BigDecimal_strtod
1323
#undef dtoa

0 commit comments

Comments
 (0)