This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix most -Wmissing-prototypes -Wmissing-declarations warnings


On Wednesday 18 February 2009 20:03:23, Tom Tromey wrote:
> >>>>> "Pedro" == Pedro Alves <pedro@codesourcery.com> writes:
> 
> Pedro> With all the latest talk about declarations and prototypes, I
> Pedro> got curious and tried building GDB on x86_64-linux with
> Pedro> `-Wmissing-declarations -Wmissing-prototypes' added to
> Pedro> WARN_CFLAGS, like so:
> 
> Nice.  I'm in favor of going this route.  It seems to me that this can
> catch real bugs and doesn't really have a downside.

I've created PR build/9877 for this.

Maintainers of each native configuration are encouraged to fix these
warnings for their hosts.

> 
> Pedro> E.g., notice that a few functions here are really unnused and
> Pedro> should probably either be deleted, or there's a bug hiding in
> Pedro> there: e.g., i386-nat.c:child_post_startup_inferior or
> Pedro> ada-typeprint.c:ada_typedef_print.
> 
> The ada_typedef_print thing is a known oddity:
> 
> http://sourceware.org/ml/gdb-patches/2008-09/msg00541.html
> 
> I was hoping an Ada maintainer would deal with this.

Yeah, me too.  I didn't know if we should delete it or if it
should be being used in the language vector but it had been missed.
I see Joel handled it already.  Thanks!

> Pedro> I've also tried adding "-Wmissing-prototypes", but it shows up a
> Pedro> few more issues than I have energy at the moment to look at.
> 
> Did you mean some other option here?

Yeah, I meant -Wstrict-prototypes.  E.g.,

 In file included from ../../src/gdb/../readline/../readline/readline.h:37,
                  from ../../src/gdb/corelow.c:43:
 ../../src/gdb/../readline/../readline/rltypedefs.h:35: aviso: function declaration isnât a prototype
 ../../src/gdb/../readline/../readline/rltypedefs.h:36: aviso: function declaration isnât a prototype
 ../../src/gdb/../readline/../readline/rltypedefs.h:37: aviso: function declaration isnât a prototype
 ../../src/gdb/../readline/../readline/rltypedefs.h:38: aviso: function declaration isnât a prototype

I've created PR build/9878 for this one.

-- 
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]