This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [ob/6.0] Fix a new sparc build failure
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Andrew Cagney <ac131313 at redhat dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Thu, 3 Jul 2003 10:00:33 -0400
- Subject: Re: [ob/6.0] Fix a new sparc build failure
- References: <20030629211653.GA29914@nevyn.them.org> <3EFF59D8.10001@redhat.com> <20030629213727.GA15297@nevyn.them.org> <3EFF64DA.70405@redhat.com>
On Sun, Jun 29, 2003 at 06:14:50PM -0400, Andrew Cagney wrote:
> >On Sun, Jun 29, 2003 at 05:27:52PM -0400, Andrew Cagney wrote:
> >
> >>>sparc_y_regnum is mentioned in the tm header, so sparc-nat.c actually
> >>>references it. Fixes another sparc-native build failure; checked in.
> >
> >>
> >>Missing an extern declaration? The nat file would be getting -Wimplict.
> >
> >
> >No, the extern declaration is there too. There was an extern followed
> >by a static, which some future version of GCC (probably 3.4) will warn
> >about.
>
> Huh?
>
> cagney@nettle$ gcc --version
> 2.95.3
> cagney@nettle$ gcc -c foo.c
> foo.c:2: warning: static declaration for `foo' follows non-static
> cagney@nettle$ cat foo.c
> extern void foo (void);
> static void foo (void) { };
>
> Notice where it occures:
>
> #if defined (GDB_MULTI_ARCH) && (GDB_MULTI_ARCH > 0)
> [...]
> /* Multi-arch the nPC and Y registers. */
> #define Y_REGNUM (sparc_y_regnum ())
> extern int sparc_npc_regnum (void);
> extern int sparc_y_regnum (void);
>
> And the sparc-elf cross target, it turns out, isn't multi-arch so
> wouldn' get the warning :-/
>
> Can you please move the extern declaration to "sparc-tdep.h"? Without
> it, there's yet another -Wmissing-prototypes to fix.
Would you prefer creating a sparc-tdep.h for this, or just moving the
prototype out of the #if? There's no sparc-tdep.h yet and I don't want
to do surgery on the sparc port to populate it properly.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer