Hi Vinson,

Thanks for the patch.

I was considering moving the gcc stuff out into its own function e.g get_gcc_frame_pointer() which could then be wrapped with #pragma GCC diagnostic which gcc 4.4 should be able to handle.

However I'm not too worried about GCC 4.4 and lower so this patch is also fine by me. Either way you decided to go you can have a:

Reviewed-by: Timothy Arceri <tarc...@itsqueeze.com>

On 22/03/18 09:10, Vinson Lee wrote:
This patch fixes these build errors with GCC 4.4.

   Compiling src/gallium/auxiliary/util/u_debug_stack.c ...
src/gallium/auxiliary/util/u_debug_stack.c: In function 
‘debug_backtrace_capture’:
src/gallium/auxiliary/util/u_debug_stack.c:268: error: #pragma GCC diagnostic 
not allowed inside functions
src/gallium/auxiliary/util/u_debug_stack.c:269: error: #pragma GCC diagnostic 
not allowed inside functions
src/gallium/auxiliary/util/u_debug_stack.c:271: error: #pragma GCC diagnostic 
not allowed inside functions

Fixes: 370e356ebab4 ("gallium: silence __builtin_frame_address nonzero argument is 
unsafe warning")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105529
Signed-off-by: Vinson Lee <v...@freedesktop.org>
---
  src/gallium/auxiliary/util/u_debug_stack.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_debug_stack.c 
b/src/gallium/auxiliary/util/u_debug_stack.c
index 974e639..846f648 100644
--- a/src/gallium/auxiliary/util/u_debug_stack.c
+++ b/src/gallium/auxiliary/util/u_debug_stack.c
@@ -264,7 +264,7 @@ debug_backtrace_capture(struct debug_stack_frame *backtrace,
     }
  #endif
-#if defined(PIPE_CC_GCC)
+#if defined(PIPE_CC_GCC) && (PIPE_CC_GCC_VERSION > 404) || defined(__clang__)
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wframe-address"
     frame_pointer = ((const void **)__builtin_frame_address(1));

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to