From: Stefan Weil <sw@weilnetz.de>
To: QEMU Trivial <qemu-trivial@nongnu.org>
Cc: Stefan Weil <sw@weilnetz.de>, QEMU Developer <qemu-devel@nongnu.org>
Subject: [Qemu-devel] [PATCH] pci: Fix compiler warning (MinGW-w64 gcc 4.9)
Date: Thu, 14 May 2015 22:38:12 +0200 [thread overview]
Message-ID: <1431635892-31996-1-git-send-email-sw@weilnetz.de> (raw)
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
next reply other threads:[~2015-05-14 20:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-14 20:38 Stefan Weil [this message]
2015-05-14 21:06 ` [Qemu-devel] [PATCH] pci: Fix compiler warning (MinGW-w64 gcc 4.9) Eric Blake
2015-05-14 21:16 ` Eric Blake
2015-05-14 21:22 ` Eric Blake
2015-05-14 21:30 ` Eric Blake
2015-05-15 8:00 ` Markus Armbruster
2015-05-15 16:20 ` Eric Blake
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1431635892-31996-1-git-send-email-sw@weilnetz.de \
--to=sw@weilnetz.de \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).