From patchwork Thu May 14 20:38:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Weil X-Patchwork-Id: 472517 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id D48F61409BB for ; Fri, 15 May 2015 06:38:35 +1000 (AEST) Received: from localhost ([::1]:56680 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ysztn-00076D-Dq for incoming@patchwork.ozlabs.org; Thu, 14 May 2015 16:38:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54858) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YsztY-0006kj-4A for qemu-devel@nongnu.org; Thu, 14 May 2015 16:38:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YsztX-0005SB-5d for qemu-devel@nongnu.org; Thu, 14 May 2015 16:38:16 -0400 Received: from qemu.weilnetz.de ([2a03:4000:2:362::1]:40715) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YsztW-0005RV-Va; Thu, 14 May 2015 16:38:15 -0400 Received: by qemu.weilnetz.de (Postfix, from userid 1000) id 1C16917F768; Thu, 14 May 2015 22:38:13 +0200 (CEST) From: Stefan Weil To: QEMU Trivial Date: Thu, 14 May 2015 22:38:12 +0200 Message-Id: <1431635892-31996-1-git-send-email-sw@weilnetz.de> X-Mailer: git-send-email 2.1.4 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a03:4000:2:362::1 Cc: Stefan Weil , QEMU Developer Subject: [Qemu-devel] [PATCH] pci: Fix compiler warning (MinGW-w64 gcc 4.9) X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 Reviewed-by: Eric Blake --- 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);