From: Andrew Cagney <cagney@gnu.org>
To: gdb-patches@sources.redhat.com, Eli Zaretskii <eliz@is.elta.co.il>
Subject: [rfc, rfa:doco] Add -Wunused-label to -Werror list
Date: Sun, 11 Jan 2004 16:59:00 -0000 [thread overview]
Message-ID: <400180C8.70803@gnu.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 150 bytes --]
Hello,
This adds -Wunused-label to the list of -W flags that GDB is compiled
against. I believe that GDB is now clean.
Eli, doco look ok?
Andrew
[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 2041 bytes --]
2004-01-11 Andrew Cagney <cagney@redhat.com>
* configure.in (build_warnings): Add -Wunused-label.
* configure: Re-generate.
Index: doc/ChangeLog
2004-01-11 Andrew Cagney <cagney@redhat.com>
* gdbint.texinfo (Coding): Add -Wunused-label to list of -Werror
warnings.
Index: configure.in
===================================================================
RCS file: /cvs/src/src/gdb/configure.in,v
retrieving revision 1.138
diff -u -r1.138 configure.in
--- configure.in 2 Jan 2004 12:40:08 -0000 1.138
+++ configure.in 11 Jan 2004 16:54:44 -0000
@@ -1024,9 +1024,10 @@
# NOTE: If you add to this list, remember to update
# gdb/doc/gdbint.texinfo.
build_warnings="-Wimplicit -Wreturn-type -Wcomment -Wtrigraphs \
--Wformat -Wparentheses -Wpointer-arith -Wuninitialized -Wformat-nonliteral"
+-Wformat -Wparentheses -Wpointer-arith -Wuninitialized -Wformat-nonliteral \
+-Wunused-label"
# Up for debate: -Wswitch -Wcomment -trigraphs -Wtrigraphs
-# -Wunused-function -Wunused-label -Wunused-variable -Wunused-value
+# -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
Index: doc/gdbint.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdbint.texinfo,v
retrieving revision 1.178
diff -u -r1.178 gdbint.texinfo
--- doc/gdbint.texinfo 10 Nov 2003 22:47:31 -0000 1.178
+++ doc/gdbint.texinfo 11 Jan 2004 16:54:56 -0000
@@ -5132,6 +5132,22 @@
@item -Wpointer-arith
@item -Wuninitialized
+
+@item -Wunused-label
+This warning has the additional benefit of detecting the coding error:
+@smallexample
+enum @{ FD_SCHEDULED, NOTHING_SCHEDULED @} sched;
+@dots{}
+switch (sched)
+ @{
+ case FD_SCHEDULED:
+ @dots{};
+ break;
+ NOTHING_SCHEDULED:
+ @dots{};
+ break;
+ @}
+@end smallexample
@end table
@emph{Pragmatics: Due to the way that @value{GDBN} is implemented most
next reply other threads:[~2004-01-11 16:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-11 16:59 Andrew Cagney [this message]
2004-01-11 18:35 ` Eli Zaretskii
2004-01-12 18:55 ` Andrew Cagney
2004-01-13 6:31 ` Eli Zaretskii
2004-01-13 17:07 ` Andrew Cagney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=400180C8.70803@gnu.org \
--to=cagney@gnu.org \
--cc=eliz@is.elta.co.il \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox