From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7024 invoked by alias); 10 Oct 2009 00:48:05 -0000 Received: (qmail 7001 invoked by uid 22791); 10 Oct 2009 00:48:04 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from smtp-outbound-2.vmware.com (HELO smtp-outbound-2.vmware.com) (65.115.85.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 10 Oct 2009 00:47:58 +0000 Received: from mailhost4.vmware.com (mailhost4.vmware.com [10.16.67.124]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id 2470B4F013 for ; Fri, 9 Oct 2009 17:47:55 -0700 (PDT) Received: from [10.20.94.141] (msnyder-server.eng.vmware.com [10.20.94.141]) by mailhost4.vmware.com (Postfix) with ESMTP id 1B3B4C9A95 for ; Fri, 9 Oct 2009 17:47:55 -0700 (PDT) Message-ID: <4ACFD8B7.4090902@vmware.com> Date: Sat, 10 Oct 2009 00:48:00 -0000 From: Michael Snyder User-Agent: Thunderbird 1.5.0.12 (X11/20080411) MIME-Version: 1.0 To: gdb@sourceware.org Subject: A strange gcc behavior, and an argument against -Wno-unused Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-10/txt/msg00187.txt.bz2 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