Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [rfc, rfa:doco] Add -Wunused-label to -Werror list
@ 2004-01-11 16:59 Andrew Cagney
  2004-01-11 18:35 ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Cagney @ 2004-01-11 16:59 UTC (permalink / raw)
  To: gdb-patches, Eli Zaretskii

[-- 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [rfc, rfa:doco] Add -Wunused-label to -Werror list
  2004-01-11 16:59 [rfc, rfa:doco] Add -Wunused-label to -Werror list Andrew Cagney
@ 2004-01-11 18:35 ` Eli Zaretskii
  2004-01-12 18:55   ` Andrew Cagney
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2004-01-11 18:35 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches

> Date: Sun, 11 Jan 2004 11:58:48 -0500
> From: Andrew Cagney <cagney@gnu.org>
> 
> Eli, doco look ok?

Yes, except that I'd suggest to say more explicitly what is the
programming error being shown in that fragment.  Someone might not get
it...


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [rfc, rfa:doco] Add -Wunused-label to -Werror list
  2004-01-11 18:35 ` Eli Zaretskii
@ 2004-01-12 18:55   ` Andrew Cagney
  2004-01-13  6:31     ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Cagney @ 2004-01-12 18:55 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 282 bytes --]

> Date: Sun, 11 Jan 2004 11:58:48 -0500
>> From: Andrew Cagney <cagney@gnu.org>
>> 
>> Eli, doco look ok?
> 
> 
> Yes, except that I'd suggest to say more explicitly what is the
> programming error being shown in that fragment.  Someone might not get
> it...

Something like ...?



[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 1697 bytes --]

2004-01-12  Andrew Cagney  <cagney@redhat.com>

	* gdbint.texinfo: Update copyright year.
	(Coding): Add -Wunused-label to list of -Werror warnings.

Index: gdbint.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdbint.texinfo,v
retrieving revision 1.178
diff -u -r1.178 gdbint.texinfo
--- gdbint.texinfo	10 Nov 2003 22:47:31 -0000	1.178
+++ gdbint.texinfo	12 Jan 2004 18:53:52 -0000
@@ -8,7 +8,7 @@
 
 @ifinfo
 This file documents the internals of the GNU debugger @value{GDBN}.
-Copyright 1990,1991,1992,1993,1994,1996,1998,1999,2000,2001,2002,2003
+Copyright 1990,1991,1992,1993,1994,1996,1998,1999,2000,2001,2002,2003,2004
    Free Software Foundation, Inc.
 Contributed by Cygnus Solutions.  Written by John Gilmore.
 Second Edition by Stan Shebs.
@@ -48,7 +48,7 @@
 
 @vskip 0pt plus 1filll
 Copyright @copyright{} 1990,1991,1992,1993,1994,1996,1998,1999,2000,2001,
-   2002, 2003  Free Software Foundation, Inc.
+   2002, 2003, 2004  Free Software Foundation, Inc.
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.1 or
@@ -5132,6 +5132,23 @@
 @item -Wpointer-arith
 
 @item -Wuninitialized
+
+@item -Wunused-label
+This warning has the additional benefit of detecting the absence of the
+@code{case} reserved word in a switch statement:
+@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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [rfc, rfa:doco] Add -Wunused-label to -Werror list
  2004-01-12 18:55   ` Andrew Cagney
@ 2004-01-13  6:31     ` Eli Zaretskii
  2004-01-13 17:07       ` Andrew Cagney
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2004-01-13  6:31 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches

> Date: Mon, 12 Jan 2004 13:55:21 -0500
> From: Andrew Cagney <cagney@gnu.org>
> 
> > Date: Sun, 11 Jan 2004 11:58:48 -0500
> >> From: Andrew Cagney <cagney@gnu.org>
> >>
> >> Eli, doco look ok?
> >
> > Yes, except that I'd suggest to say more explicitly what is the
> > programming error being shown in that fragment.  Someone might not get
> > it...
> 
> Something like ...?

Yes, thanks.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [rfc, rfa:doco] Add -Wunused-label to -Werror list
  2004-01-13  6:31     ` Eli Zaretskii
@ 2004-01-13 17:07       ` Andrew Cagney
  0 siblings, 0 replies; 5+ messages in thread
From: Andrew Cagney @ 2004-01-13 17:07 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb-patches

>> Date: Mon, 12 Jan 2004 13:55:21 -0500
>> From: Andrew Cagney <cagney@gnu.org>
>> 
> 
>> > Date: Sun, 11 Jan 2004 11:58:48 -0500
> 
>> >> From: Andrew Cagney <cagney@gnu.org>
>> >>
>> >> Eli, doco look ok?
> 
>> >
>> > Yes, except that I'd suggest to say more explicitly what is the
>> > programming error being shown in that fragment.  Someone might not get
>> > it...
> 
>> 
>> Something like ...?
> 
> 
> Yes, thanks.

Thanks, committed.

Andrew



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-01-13 17:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-11 16:59 [rfc, rfa:doco] Add -Wunused-label to -Werror list Andrew Cagney
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox