This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH c++ 01/12] linux-ppc-low.c: Remove forward declaration, move ppc_arch_setup lower
- From: Pedro Alves <palves at redhat dot com>
- To: Simon Marchi <simon dot marchi at ericsson dot com>, gdb-patches at sourceware dot org
- Cc: Simon Marchi <simon dot marchi at polymtl dot ca>
- Date: Tue, 03 Nov 2015 16:05:52 +0000
- Subject: Re: [PATCH c++ 01/12] linux-ppc-low.c: Remove forward declaration, move ppc_arch_setup lower
- Authentication-results: sourceware.org; auth=none
- References: <1446560804-18858-1-git-send-email-simon dot marchi at ericsson dot com>
On 11/03/2015 02:26 PM, Simon Marchi wrote:
> From: Simon Marchi <simon.marchi@polymtl.ca>
>
> g++ doesn't like that we forward-declare a variable that is initialized
> later in the file. It's easy enough to re-order things to fix it.
Yeah, doesn't work in C either with -fno-common.
>
> Fixes
>
> /home/simark/src/binutils-gdb/gdb/gdbserver/linux-ppc-low.c:663:28: error: redefinition of âusrregs_info ppc_usrregs_infoâ
> static struct usrregs_info ppc_usrregs_info =
> ^
> /home/simark/src/binutils-gdb/gdb/gdbserver/linux-ppc-low.c:381:28: note: âusrregs_info ppc_usrregs_infoâ previously declared here
> static struct usrregs_info ppc_usrregs_info;
> ^
>
> gdb/gdbserver/ChangeLog:
>
> * linux-ppc-low.c (ppc_usrregs_info): Remove
> forward-declaration.
> (ppc_arch_setup): Move lower in file.
OK.
Thanks,
Pedro Alves