From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37073) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uu76D-0000vQ-59 for qemu-devel@nongnu.org; Tue, 02 Jul 2013 16:22:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uu76B-0004VR-NZ for qemu-devel@nongnu.org; Tue, 02 Jul 2013 16:22:53 -0400 Received: from [2a03:4000:1::4e2f:c7ac:d] (port=53447 helo=v220110690675601.yourvserver.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uu76B-0004VK-7y for qemu-devel@nongnu.org; Tue, 02 Jul 2013 16:22:51 -0400 Message-ID: <51D33696.7030609@weilnetz.de> Date: Tue, 02 Jul 2013 22:22:46 +0200 From: Stefan Weil MIME-Version: 1.0 References: <1372096130-24994-1-git-send-email-sw@weilnetz.de> <1372096130-24994-4-git-send-email-sw@weilnetz.de> <51D2CB63.1020308@suse.de> In-Reply-To: <51D2CB63.1020308@suse.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [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: Alexander Graf Cc: qemu-devel , David Gibson Am 02.07.2013 14:45, schrieb Alexander Graf: > On 06/24/2013 07:48 PM, Stefan Weil wrote: >> 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); > > Please fix this one up with g_assert_not_reached() as well. > > Alex I did, and you applied it to ppc-next. :-) See http://patchwork.ozlabs.org/patch/255738/. Cheers Stefan