From c996f4091fb7af3ff28842ff4b6facdb7f0c35a2 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Thu, 12 Sep 2024 15:04:18 -0400 Subject: [PATCH] Ignore -Wdangling-pointer in rb_gc_set_stack_end MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes this compiler warning: thread.c:4530:18: warning: storing the address of local variable ‘stack_end’ in ‘*stack_end_p’ [-Wdangling-pointer=] 4530 | *stack_end_p = &stack_end; | ~~~~~~~~~~~~~^~~~~~~~~~~~ --- thread.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/thread.c b/thread.c index 104205beb2..5a79200785 100644 --- a/thread.c +++ b/thread.c @@ -4527,7 +4527,12 @@ void rb_gc_set_stack_end(VALUE **stack_end_p) { VALUE stack_end; +COMPILER_WARNING_PUSH +#if __has_warning("-Wdangling-pointer") +COMPILER_WARNING_IGNORED(-Wdangling-pointer); +#endif *stack_end_p = &stack_end; +COMPILER_WARNING_POP } #endif