[PATCH] glx: Ignore unused function warnings
Gaetan Nadon
memsize at videotron.ca
Sat Feb 8 06:51:22 PST 2014
On 14-02-07 07:10 PM, Keith Packard wrote:
> indirect_dispatch_swap.c, which is autogenerated from a mesa script,
> contains the function 'bswap_CARD64', which is never used in the
> file. While it would be nice to fix this upstream, that's "hard", so
> this change causes these warnings to be ignored for just this
> directory.
>
> Signed-off-by: Keith Packard <keithp at keithp.com>
> ---
> glx/Makefile.am | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/glx/Makefile.am b/glx/Makefile.am
> index 54e8140..9838581 100644
> --- a/glx/Makefile.am
> +++ b/glx/Makefile.am
> @@ -27,6 +27,8 @@ if DRI2_AIGLX
> AM_CPPFLAGS += -I$(top_srcdir)/hw/xfree86/dri2
> endif
>
> +AM_CFLAGS += -Wno-unused-function
> +
> indirect_sources = \
> indirect_dispatch.c \
> indirect_dispatch.h \
Works only for the GNU compiler.
The util-macros XORG_COMPILER_FLAGS uses XORG_TESTSET_CFLAG to test each
flag we use for compiler support. This is the reason why you see this
type of line at configure time:
checking if gcc -std=gnu99 supports -Wall... yes
To introduce a new compiler flag, add an XORG_TESTSET_CFLAG statement in
configure.ac such as:
XORG_TESTSET_CFLAG ([NO_UNUSED_FUNCTION], [-Wno-unused-function
<solaris-equivalent-if-any>])
Each flag is tested in the set and the first one that works is accepted.
In the Makefile:
+AM_CFLAGS += $(NO_UNUSED_FUNCTION)
You should then see at config time:
checking if gcc -std=gnu99 supports -Wno-unused-function... yes
If there is no equivalent on Solaris, the variable NO_UNUSED_FUNCTION
will be empty. If -Wno-unused-function is accepted on Solaris, it will
be used.
This is the first time a warning flag is added to the comprehensive set
we already provide through util-macros.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg-devel/attachments/20140208/3b4d0bed/attachment.html>
More information about the xorg-devel
mailing list