All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-trivial] [PATCH] pci: Fix compiler warning (MinGW-w64 gcc 4.9)
@ 2015-05-14 20:38 ` Stefan Weil
  0 siblings, 0 replies; 14+ messages in thread
From: Stefan Weil @ 2015-05-14 20:38 UTC (permalink / raw)
  To: QEMU Trivial; +Cc: Stefan Weil, QEMU Developer

i686-w64-mingw32-gcc 4.9.1 from Debian Jessie complains:

hw/pci/pci.c:938:29: warning:
 array subscript is above array bounds [-Warray-bounds]

Using g_assert instead of assert fixes this warning.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
 hw/pci/pci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 48f19a3..34f71dc 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -927,8 +927,8 @@ void pci_register_bar(PCIDevice *pci_dev, int region_num,
     uint64_t wmask;
     pcibus_t size = memory_region_size(memory);
 
-    assert(region_num >= 0);
-    assert(region_num < PCI_NUM_REGIONS);
+    g_assert(region_num >= 0);
+    g_assert(region_num < PCI_NUM_REGIONS);
     if (size & (size-1)) {
         fprintf(stderr, "ERROR: PCI region size must be pow2 "
                     "type=0x%x, size=0x%"FMT_PCIBUS"\n", type, size);
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2015-05-15 16:20 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-14 20:38 [Qemu-trivial] [PATCH] pci: Fix compiler warning (MinGW-w64 gcc 4.9) Stefan Weil
2015-05-14 20:38 ` [Qemu-devel] " Stefan Weil
2015-05-14 21:06 ` [Qemu-trivial] " Eric Blake
2015-05-14 21:06   ` Eric Blake
2015-05-14 21:16   ` [Qemu-trivial] " Eric Blake
2015-05-14 21:16     ` Eric Blake
2015-05-14 21:22     ` [Qemu-trivial] " Eric Blake
2015-05-14 21:22       ` Eric Blake
2015-05-14 21:30     ` [Qemu-trivial] " Eric Blake
2015-05-14 21:30       ` Eric Blake
2015-05-15  8:00 ` [Qemu-trivial] " Markus Armbruster
2015-05-15  8:00   ` Markus Armbruster
2015-05-15 16:20   ` [Qemu-trivial] " Eric Blake
2015-05-15 16:20     ` Eric Blake

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.