From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=49116 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P4FpL-0002wc-E4 for qemu-devel@nongnu.org; Fri, 08 Oct 2010 12:29:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P4FXS-0004Nj-K7 for qemu-devel@nongnu.org; Fri, 08 Oct 2010 12:11:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:30486) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P4FXS-0004NL-DM for qemu-devel@nongnu.org; Fri, 08 Oct 2010 12:11:18 -0400 Message-ID: <4CAF429F.5010303@redhat.com> Date: Fri, 08 Oct 2010 18:11:11 +0200 From: Paolo Bonzini MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH 04/11] lsi53c895a: avoid a write only variable References: <4CAD74C5.5060102@redhat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: Markus Armbruster , qemu-devel@nongnu.org On 10/07/2010 08:53 PM, Blue Swirl wrote: > On Thu, Oct 7, 2010 at 9:20 AM, Markus Armbruster wrote: >> Paolo Bonzini writes: >> >>> On 10/06/2010 11:32 PM, Blue Swirl wrote: >>>> Compiling with GCC 4.6.0 20100925 produced a warning: >>>> /src/qemu/hw/lsi53c895a.c: In function 'lsi_do_msgout': >>>> /src/qemu/hw/lsi53c895a.c:848:9: error: variable 'len' set but not >>>> used [-Werror=unused-but-set-variable] >>>> >>>> Fix by making the variable declaration and its uses also conditional >>>> to debug definition. >>> >>> NACK, this uglifies the code and loses track of _what_ is that msgbyte >>> we're reading. > > That information could be saved by adding a comment, I used that > approach for vmstate.c. Yes, that's fine for vmstate.c, but here you are also uselessly duplicating the code. (void) len is good though. I suggest doing the same for i386 too (and there you could put a reference to the manual). Paolo