This disables the warning that is given by the C compiler when it is
compiling the generic implementation of the backtrace facility used
on some platforms.
This happens when a positive frame level is requested, which can be
problematic in the general case. But this implementation is known to
work for platforms where it is used, so the warning is useless here.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* tracebak.c [generic implementation]: Add pragma GCC diagnostic
to disable warning about __builtin_frame_address.
diff --git a/gcc/ada/tracebak.c b/gcc/ada/tracebak.c
--- a/gcc/ada/tracebak.c
+++ b/gcc/ada/tracebak.c
@@ -690,6 +690,9 @@ __gnat_backtrace (void ** traceback __attribute__((unused)),
#elif defined (USE_GENERIC_UNWINDER)
+/* No warning since the cases where FRAME_LEVEL > 0 are known to work. */
+#pragma GCC diagnostic ignored "-Wframe-address"
+
#ifndef CURRENT_STACK_FRAME
# define CURRENT_STACK_FRAME ({ char __csf; &__csf; })
#endif