From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26707 invoked by alias); 11 Jan 2004 16:59:01 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 26672 invoked from network); 11 Jan 2004 16:58:49 -0000 Received: from unknown (HELO localhost.redhat.com) (65.49.3.48) by sources.redhat.com with SMTP; 11 Jan 2004 16:58:49 -0000 Received: from gnu.org (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 549DB2B8F; Sun, 11 Jan 2004 11:58:48 -0500 (EST) Message-ID: <400180C8.70803@gnu.org> Date: Sun, 11 Jan 2004 16:59:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030820 MIME-Version: 1.0 To: gdb-patches@sources.redhat.com, Eli Zaretskii Subject: [rfc, rfa:doco] Add -Wunused-label to -Werror list Content-Type: multipart/mixed; boundary="------------080708070403080702010205" X-SW-Source: 2004-01/txt/msg00281.txt.bz2 This is a multi-part message in MIME format. --------------080708070403080702010205 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 150 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 --------------080708070403080702010205 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 2041 2004-01-11 Andrew Cagney * configure.in (build_warnings): Add -Wunused-label. * configure: Re-generate. Index: doc/ChangeLog 2004-01-11 Andrew Cagney * 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 --------------080708070403080702010205--