]> git.proxmox.com Git - qemu.git/commitdiff
spapr: Fix compiler warnings for some versions of gcc
authorStefan Weil <sw@weilnetz.de>
Sat, 29 Jun 2013 13:47:26 +0000 (15:47 +0200)
committerAlexander Graf <agraf@suse.de>
Thu, 11 Jul 2013 16:51:23 +0000 (18:51 +0200)
i686-w64-mingw32-gcc (GCC) 4.6.3 from Debian wheezy reports these warnings:

hw/ppc/spapr_hcall.c:188:1: warning:
 control reaches end of non-void function [-Wreturn-type]

hw/ppc/spapr_pci.c:454:1: warning:
 control reaches end of non-void function [-Wreturn-type]

Both warnings are fixed by using g_assert_not_reached instead of assert.
A second line with assert(0) in spapr_pci.c which did not raise a compiler
warning was modified, too, because g_assert_not_reached documents the
purpose of that statement and is not removed in release builds.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
hw/ppc/spapr_hcall.c
hw/ppc/spapr_pci.c

index e6f321d5389e5c5a65a0ace04bef88e531755d75..8bad27fb8a92c54287473102880c6bb4e550a337 100644 (file)
@@ -184,7 +184,7 @@ static target_ulong h_remove(PowerPCCPU *cpu, sPAPREnvironment *spapr,
         return H_HARDWARE;
     }
 
-    assert(0);
+    g_assert_not_reached();
 }
 
 #define H_BULK_REMOVE_TYPE             0xc000000000000000ULL
index 18f2e2f8428133338a89e7b15f4ff13672cd91aa..318bc9d6efeda99d95ef2fc8a87c720a902536e2 100644 (file)
@@ -451,7 +451,7 @@ static uint64_t spapr_io_read(void *opaque, hwaddr addr,
     case 4:
         return cpu_inl(addr);
     }
-    assert(0);
+    g_assert_not_reached();
 }
 
 static void spapr_io_write(void *opaque, hwaddr addr,
@@ -468,7 +468,7 @@ static void spapr_io_write(void *opaque, hwaddr addr,
         cpu_outl(addr, data);
         return;
     }
-    assert(0);
+    g_assert_not_reached();
 }
 
 static const MemoryRegionOps spapr_io_ops = {