From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36472) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXDYS-00010w-LI for qemu-devel@nongnu.org; Wed, 23 May 2012 11:33:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SXDYM-0002IT-4e for qemu-devel@nongnu.org; Wed, 23 May 2012 11:32:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52356) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXDYL-0002Hn-Gt for qemu-devel@nongnu.org; Wed, 23 May 2012 11:32:46 -0400 Message-ID: <4FBD0317.2040507@redhat.com> Date: Wed, 23 May 2012 17:32:39 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <1337721812-30229-1-git-send-email-sw@weilnetz.de> <4FBD026C.5040304@weilnetz.de> In-Reply-To: <4FBD026C.5040304@weilnetz.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1.1] virtio: Fix compiler warning for non Linux hosts List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: Stefan Hajnoczi , Anthony Liguori , qemu-devel@nongnu.org, Paolo Bonzini Am 23.05.2012 17:29, schrieb Stefan Weil: > Am 23.05.2012 10:09, schrieb Stefan Hajnoczi: >> On Tue, May 22, 2012 at 10:23 PM, Stefan Weil wrote: >>> The local variables ret, i are only used if __linux__ is defined. >>> >>> Signed-off-by: Stefan Weil >>> --- >>> hw/virtio-blk.c | 4 +++- >>> 1 file changed, 3 insertions(+), 1 deletion(-) >> The #ifdef __linux__ further down in the function declares the local >> hdr variable. We could move ret and i down into the #ifdef instead of >> adding a new one. > > I noticed that, but declaring variables anywhere is C++, not C code. It's called C99. Kevin