Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* A strange gcc behavior, and an argument against -Wno-unused
@ 2009-10-10  0:48 Michael Snyder
  2009-10-10  2:24 ` Dave Korn
  0 siblings, 1 reply; 15+ messages in thread
From: Michael Snyder @ 2009-10-10  0:48 UTC (permalink / raw)
  To: gdb

Hey all,

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, and
so I removed the "-Wno-unused" from the makefile.

But the first thing that happened was that my compile failed
with the following warning (which of course was treated as an
error, because we also have -Werror):

     i386-tdep.c:4149: warning: statement with no effect

Now here's the line in question, from i386_process_record:

           ir.rm != ir.rex_b;

 From context and other examples, I'm pretty sure that this
is a typo, and was meant to read "|=", not "!=".  No sweat,
I'll fix it, or submit it for review anyway.

BUT!  The fact that this escaped being detected by the compiler
bothers me a lot!  I don't know whether to think of it as a
compiler bug, or to reason "well, we said "don't warn us about
things that are unused, and this is basically an unused
statement".

So, for discussion, should we remove -Wno-unused?

Michael


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

end of thread, other threads:[~2009-10-14 19:45 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-10  0:48 A strange gcc behavior, and an argument against -Wno-unused Michael Snyder
2009-10-10  2:24 ` Dave Korn
2009-10-10 16:45   ` Pedro Alves
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

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