Bug 105529 - u_debug_stack.c:268: error: #pragma GCC diagnostic not allowed inside functions
Summary: u_debug_stack.c:268: error: #pragma GCC diagnostic not allowed inside functions
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: mesa-dev
QA Contact: mesa-dev
URL:
Whiteboard:
Keywords: bisected, regression
Depends on:
Blocks:
 
Reported: 2018-03-15 18:23 UTC by Vinson Lee
Modified: 2018-03-27 06:11 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Vinson Lee 2018-03-15 18:23:31 UTC
GCC 4.4 build error

  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


commit 370e356ebab4885fc19b2b1d1de2816b6cd4dfc8
Author: Timothy Arceri <tarceri@itsqueeze.com>
Date:   Fri Mar 9 11:00:55 2018 +1100

    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>
Comment 1 Timothy Arceri 2018-03-27 06:11:20 UTC
Fixed by:

author	Vinson Lee <vlee@freedesktop.org>
commit	dc94a0506f1d267a761961d3ac905d77de3dae2e

gallium: Do not add -Wframe-address option for gcc <= 4.4.
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 <vlee@freedesktop.org>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.