[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 3/3] spapr: Fix compiler warning for some versio

From: Alexander Graf
Subject: Re: [Qemu-devel] [PATCH 3/3] spapr: Fix compiler warning for some versions of gcc (spapr_io_read)
Date: Tue, 02 Jul 2013 14:45:23 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.3) Gecko/20120306 Thunderbird/10.0.3

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<address@hidden>
  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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]