summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gc.c4
-rw-r--r--internal.h10
2 files changed, 11 insertions, 3 deletions
diff --git a/gc.c b/gc.c
index b38646988d..fe778aa917 100644
--- a/gc.c
+++ b/gc.c
@@ -4164,11 +4164,9 @@ ruby_stack_check(void)
return stack_check(GET_EC(), STACKFRAME_FOR_CALL_CFUNC);
}
-ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS
-(
+ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(static void mark_locations_array(rb_objspace_t *objspace, register const VALUE *x, register long n));
static void
mark_locations_array(rb_objspace_t *objspace, register const VALUE *x, register long n)
-)
{
VALUE v;
while (n--) {
diff --git a/internal.h b/internal.h
index 2f3124f791..1a030566d3 100644
--- a/internal.h
+++ b/internal.h
@@ -68,6 +68,16 @@ extern "C" {
# define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) x
#endif
+#if defined(NO_SANITIZE) && defined(__GNUC__) &&! defined(__clang__)
+/* GCC warns about unknown sanitizer, which is annoying. */
+#undef NO_SANITIZE
+#define NO_SANITIZE(x, y) \
+ COMPILER_WARNING_PUSH; \
+ COMPILER_WARNING_IGNORED(-Wattributes); \
+ __attribute__((__no_sanitize__(x))) y; \
+ COMPILER_WARNING_POP
+#endif
+
#ifndef NO_SANITIZE
# define NO_SANITIZE(x, y) y
#endif