From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:57038) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QF9bs-0005V1-SU for qemu-devel@nongnu.org; Wed, 27 Apr 2011 14:37:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QF9bp-0006xB-25 for qemu-devel@nongnu.org; Wed, 27 Apr 2011 14:37:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35057) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QF9bo-0006wp-MW for qemu-devel@nongnu.org; Wed, 27 Apr 2011 14:37:09 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p3RIb6mk017812 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 27 Apr 2011 14:37:06 -0400 Received: from ykaul.tlv.redhat.com (vpn-201-23.tlv.redhat.com [10.35.201.23]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p3RIb4n7000802 for ; Wed, 27 Apr 2011 14:37:05 -0400 Message-ID: <4DB8624F.9060504@redhat.com> Date: Wed, 27 Apr 2011 21:37:03 +0300 From: Yaniv Kaul MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] Patch for 'set but not used' variable in atapi.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org I'm pretty sure it's not in the right format, without signed-off, etc,=20 but perhaps it could be put into the trivial or block branches. Fixes the following error (with gcc 4.6, default settings): /home/ykaul/qemu/hw/ide/atapi.c: In function =91ide_atapi_cmd=92: /home/ykaul/qemu/hw/ide/atapi.c:1083:20: error: variable =91packet=92 set= =20 but not used [-Werror=3Dunused-but-set-variable] cc1: all warnings being treated as errors Regretfully, there are more to fix, with or without KVM support. The tcg=20 one puzzles me a bit: CC x86_64-softmmu/tcg/tcg.o /home/ykaul/qemu/tcg/tcg.c: In function =91tcg_gen_callN=92: /home/ykaul/qemu/tcg/tcg.c:589:9: error: variable =91call_type=92 set but= =20 not used [-Werror=3Dunused-but-set-variable] cc1: all warnings being treated as errors Removing the variable and the set line actually works, although I see=20 the variables used few lines later. Some #ifdef I'm not seeing, probably. Thanks, Y. Signed-off-by: Yaniv Kaul --- diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c index 690a0ab..334d6fd 100644 --- a/hw/ide/atapi.c +++ b/hw/ide/atapi.c @@ -1080,10 +1080,12 @@ static const struct { void ide_atapi_cmd(IDEState *s) { - const uint8_t *packet; uint8_t *buf; +#ifdef DEBUG_IDE_ATAPI + const uint8_t *packet; packet =3D s->io_buffer; +#endif buf =3D s->io_buffer; #ifdef DEBUG_IDE_ATAPI {