From: Pedro Alves <pedro@codesourcery.com>
To: gdb@sourceware.org
Cc: Dave Korn <dave.korn.cygwin@googlemail.com>,
Michael Snyder <msnyder@vmware.com>
Subject: Re: A strange gcc behavior, and an argument against -Wno-unused
Date: Sat, 10 Oct 2009 16:45:00 -0000 [thread overview]
Message-ID: <200910101745.27358.pedro@codesourcery.com> (raw)
In-Reply-To: <4ACFF3C7.3030802@gmail.com>
On Saturday 10 October 2009 01:43:35, Michael Snyder wrote:
> We have "-Wno-unused" in our Makefile.in, as a result of which
> we have accumulated a huge pool of unused variables, which
> probably get optimized away and so don't hurt anything, but
> which clutter up the code.
>
> I was playing around with the idea of cleaning them up,
Yeah. I think Aleksandar's "-Wall patches" patch
series must have fixed most of these already. Unfortunately,
the patch was so large, that it ended up dropped on
the floor. Please, if you have patches already that
properly fix some warnings, let's put those in, even
if we don't enable more warnings by default immediately.
> and
> so I removed the "-Wno-unused" from the makefile.
>
(...)
> So, for discussion, should we remove -Wno-unused?
I think that would be nice. I'll all for having
tighter warnings and leaner code. But we should try
to be smooth, and first get rid of all the corresponding
warnings in at least an --enable-targets=all build.
It can't hurt. That discussion you're proposing should
resolve faster if removing the switch doesn't result
in a gazillion warnings and breaking everyone's builds.
On Saturday 10 October 2009 03:39:03, Dave Korn wrote:
> Or append "-Wunused-value"?
Sounds like a good first step to me.
Curious as I am, I tried a build with that on. An --enable-targets=all
on x86_64-linux built with
make WARN_CFLAGS="-Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral -Wno-pointer-sign -Wno-unused -Wno-switch -Wno-char-subscripts -Werror -Wunused-value" -k
has only revealed this extra warning (in addition to the one
you pointed out):
../../src/gdb/mi/mi-cmd-stack.c: In function 'list_args_or_locals':
../../src/gdb/mi/mi-cmd-stack.c:265: warning: left-hand operand of comma expression has no effect
"Fixed" as below.
--
Pedro Alves
2009-10-10 Pedro Alves <pedro@codesourcery.com>
* mi/mi-cmd-stack.c (list_args_or_locals): Use internal_error.
Put "break" statements on their own line.
---
gdb/mi/mi-cmd-stack.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
Index: src/gdb/mi/mi-cmd-stack.c
===================================================================
--- src.orig/gdb/mi/mi-cmd-stack.c 2009-10-10 16:30:30.000000000 +0100
+++ src/gdb/mi/mi-cmd-stack.c 2009-10-10 17:00:14.000000000 +0100
@@ -256,13 +256,17 @@ list_args_or_locals (enum what_to_list w
switch (what)
{
case locals:
- name_of_result = "locals"; break;
+ name_of_result = "locals";
+ break;
case arguments:
- name_of_result = "args"; break;
+ name_of_result = "args";
+ break;
case all:
- name_of_result = "variables"; break;
+ name_of_result = "variables";
+ break;
default:
- gdb_assert (("unexpected value", 0));
+ internal_error (__FILE__, __LINE__,
+ "unexpected what_to_list: %d", (int) what);
}
cleanup_list = make_cleanup_ui_out_list_begin_end (uiout, name_of_result);
next prev parent reply other threads:[~2009-10-10 16:45 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-10 0:48 Michael Snyder
2009-10-10 2:24 ` Dave Korn
2009-10-10 16:45 ` Pedro Alves [this message]
2009-10-10 18:08 ` Eli Zaretskii
2009-10-10 18:24 ` Pedro Alves
2009-10-10 18:25 ` Tom Tromey
2009-10-10 18:37 ` Eli Zaretskii
2009-10-10 18:50 ` Pedro Alves
2009-10-10 19:46 ` Eli Zaretskii
2009-10-13 14:09 ` Pedro Alves
2009-10-13 15:33 ` Pierre Muller
2009-10-13 16:42 ` Tom Tromey
2009-10-13 15:48 ` Tom Tromey
2009-10-14 19:45 ` Pedro Alves
2009-10-10 18:30 ` Tom Tromey
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=200910101745.27358.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=dave.korn.cygwin@googlemail.com \
--cc=gdb@sourceware.org \
--cc=msnyder@vmware.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