[ob/6.0] Fix a new sparc build failure
Andrew Cagney
ac131313@redhat.com
Sun Jun 29 22:15:00 GMT 2003
> 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.
Andrew
More information about the Gdb-patches
mailing list