This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: -Wall
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: pkoning at equallogic dot com
- Cc: gdb at sources dot redhat dot com
- Date: Wed, 31 Aug 2005 21:32:11 +0200 (CEST)
- Subject: Re: -Wall
- References: <17173.64766.911558.85264@gargle.gargle.HOWL>
> Date: Wed, 31 Aug 2005 14:54:54 -0400
> From: Paul Koning <pkoning@equallogic.com>
>
> Gdb (6.3 at least) generates a bunch of warnings when compiled with
> -Wall (or a similar set of "warn for everything I can think of"
> switches that are popular around here).
>
> Would patches to cure these be welcome?
>
configure.ac has this note:
# NOTE: Don't add -Wall or -Wunused, they both include
# -Wunused-parameter which reports bogus warnings.
so currently GDB has its own set of warning flags, currently:
build_warnings="-Wimplicit -Wreturn-type -Wcomment -Wtrigraphs \
-Wformat -Wparentheses -Wpointer-arith -Wformat-nonliteral \
-Wunused-label -Wunused-function"
Further down there is:
# Up for debate: -Wswitch -Wcomment -trigraphs -Wtrigraphs
# -Wunused-function -Wunused-variable -Wunused-value
# -Wchar-subscripts -Wtraditional -Wshadow -Wcast-qual
# -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes
# -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls
# -Woverloaded-virtual -Winline -Werror"
which probably qualifies as "warn for almost everything I can think
of". The main reason for not enabling those is that there is still
too much shoddy code in GDB that triggers these, making -Werror
basically unusable. But I'd certainly welcome patches to remove
warnings on that list.
The best thing to do would probably be to target the options one at a
time and then add the corresponding -W to the list used by GDB.
Mark