summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Arceri <tarceri@itsqueeze.com>2018-03-09 11:00:55 +1100
committerTimothy Arceri <tarceri@itsqueeze.com>2018-03-13 09:38:10 +1100
commit370e356ebab4885fc19b2b1d1de2816b6cd4dfc8 (patch)
treee5266367853b5c8b0fa7251d9dbb39bb791c3624
parentb7c6870f87acafd592629d1c3127b54e52689f02 (diff)
gallium: silence __builtin_frame_address nonzero argument is unsafe warning
Calling __builtin_frame_address with a nonzero argument is unsafe but is sometimes done for debugging purposes. Since this code is part of some debug util code I'm assuming that is the case here and using GCC pragma to silence the warning. Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
-rw-r--r--src/gallium/auxiliary/util/u_debug_stack.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_debug_stack.c b/src/gallium/auxiliary/util/u_debug_stack.c
index 6ddacdb362f..974e639e89d 100644
--- a/src/gallium/auxiliary/util/u_debug_stack.c
+++ b/src/gallium/auxiliary/util/u_debug_stack.c
@@ -265,7 +265,10 @@ debug_backtrace_capture(struct debug_stack_frame *backtrace,
#endif
#if defined(PIPE_CC_GCC)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wframe-address"
frame_pointer = ((const void **)__builtin_frame_address(1));
+#pragma GCC diagnostic pop
#elif defined(PIPE_CC_MSVC) && defined(PIPE_ARCH_X86)
__asm {
mov frame_pointer, ebp