Received: from eggs.gnu.org ([2001:4830:134:3::10]:34684) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrAsv-0001UY-17 for qemu-devel@nongnu.org; Mon, 24 Jun 2013 13:49:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UrAst-0008G2-JL for qemu-devel@nongnu.org; Mon, 24 Jun 2013 13:49:00 -0400 Received: from qemu.weilnetz.de ([37.221.198.45]:45774 helo=v2201305906712890.yourvserver.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrAst-0008F3-CL for qemu-devel@nongnu.org; Mon, 24 Jun 2013 13:48:59 -0400 From: Stefan Weil Date: Mon, 24 Jun 2013 19:48:49 +0200 Message-Id: <1372096130-24994-4-git-send-email-sw@weilnetz.de> In-Reply-To: <1372096130-24994-1-git-send-email-sw@weilnetz.de> References: <1372096130-24994-1-git-send-email-sw@weilnetz.de> Subject: [Qemu-devel] [PATCH 3/3] spapr: Fix compiler warning for some versions of gcc (spapr_io_read) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson , Alexander Graf Cc: Stefan Weil , qemu-devel i686-w64-mingw32-gcc (GCC) 4.6.3 from Debian wheezy reports this warning: hw/ppc/spapr_pci.c:454:1: warning: control reaches end of non-void function [-Wreturn-type] Adding a default case to the switch statement satisfies the compiler. This modification requires moving the assert statement. Signed-off-by: Stefan Weil --- hw/ppc/spapr_pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index 04e8362..c04086c 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -448,9 +448,10 @@ static uint64_t spapr_io_read(void *opaque, hwaddr addr, case 2: return cpu_inw(addr); case 4: + default: + assert(size == 4); return cpu_inl(addr); } - assert(0); } static void spapr_io_write(void *opaque, hwaddr addr, -- 1.7.10.4