This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Wrap gdb_agent_op_sizes by #ifndef IN_PROCESS_AGENT
- From: Pedro Alves <palves at redhat dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>, gdb-patches at sourceware dot org
- Date: Wed, 30 Sep 2015 13:37:50 +0100
- Subject: Re: [PATCH] Wrap gdb_agent_op_sizes by #ifndef IN_PROCESS_AGENT
- Authentication-results: sourceware.org; auth=none
- References: <1442842864-2326-1-git-send-email-yao dot qi at linaro dot org>
On 09/21/2015 02:41 PM, Yao Qi wrote:
> Hi,
> I see the following build warning with recent GCC built from mainline,
>
> aarch64-none-linux-gnu-gcc -g -O2 -I. -I/home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver -I/home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/../common -I/home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/../regformats -I/home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/.. -I/home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/../../include -I/home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/../gnulib/import -Ibuild-gnulib-gdbserver/import -Wall -Wpointer-arith -Wformat-nonliteral -Wno-char-subscripts -Wempty-body -Wdeclaration-after-statement -Werror -DGDBSERVER -DCONFIG_UST_GDB_INTEGRATION -fPIC -DIN_PROCESS_AGENT -fvisibility=hidden -c -o ax-ipa.o -MT ax-ipa.o -MMD -MP -MF .deps/ax-ipa.Tpo `echo " -Wall -Wpointer-arith -Wformat-nonliteral -Wno-char-subscripts -Wempty-body -Wdeclaration-after-statement " | sed "s/ -Wformat-nonliteral / -Wno-format-nonliteral /g"` /home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/ax.c
> /home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/ax.c:73:28: error: 'gdb_agent_op_sizes' defined but not used [-Werror=unused-const-variable]
> static const unsigned char gdb_agent_op_sizes [gdb_agent_op_last] =
> ^
> cc1: all warnings being treated as errors
>
> gdb_agent_op_sizes is only used in function is_goto_target, which is
> defined inside #ifndef IN_PROCESS_AGENT. This warning is not arch
> specific, so GCC mainline for other targets should produce this warning
> too, although this warning is triggered by enabling aarch64 fast
> tracepoint. The fix is to move gdb_agent_op_sizes to #ifndef IN_PROCESS_AGENT.
>
> gdb/gdbserver:
>
> 2015-09-21 Yao Qi <yao.qi@linaro.org>
>
> * ax.c [!IN_PROCESS_AGENT] (gdb_agent_op_sizes): Define it.
LGTM.
Thanks,
Pedro Alves