From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37055) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yt0i0-0001oe-1d for qemu-devel@nongnu.org; Thu, 14 May 2015 17:30:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yt0hw-0001va-J9 for qemu-devel@nongnu.org; Thu, 14 May 2015 17:30:23 -0400 Message-ID: <555513E9.3010601@redhat.com> Date: Thu, 14 May 2015 15:30:17 -0600 From: Eric Blake MIME-Version: 1.0 References: <1431635892-31996-1-git-send-email-sw@weilnetz.de> <55550E54.2080405@redhat.com> <555510C2.7020507@redhat.com> In-Reply-To: <555510C2.7020507@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="IM9tdXlwtUnPfntgDIHIAr2LihrM4505M" Subject: Re: [Qemu-devel] [PATCH] pci: Fix compiler warning (MinGW-w64 gcc 4.9) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil , QEMU Trivial Cc: QEMU Developer This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --IM9tdXlwtUnPfntgDIHIAr2LihrM4505M Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/14/2015 03:16 PM, Eric Blake wrote: > On 05/14/2015 03:06 PM, Eric Blake wrote: >> On 05/14/2015 02:38 PM, Stefan Weil wrote: >>> 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. >> >> Is that because the mingw headers don't properly mark the expansion of= >> the failed branch of assert() as noreturn, whereas g_assert() does, an= d >> therefore the compiler has more information about what variables must = be >> if the rest of the function is reached? >> >=20 >> >> Meanwhile, you may want to file a bug to the mingw maintainers that >> their header is puny when compared to glibc assert() or to glib's >> g_assert, when it comes to giving gcc decent hints. >=20 > Oh, I was right! >=20 > glibc /usr/include/assert.h: > vs mingw /usr/i686-w64-mingw32/sys-root/mingw/include/assert.h: and glib's version in /usr/include/glib-2.0/glib/gtestutils.h: #define g_assert(expr) G_STMT_START { \ if G_LIKELY (expr) ; else \ g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \ #expr); \ } G_STMT_END GLIB_AVAILABLE_IN_ALL void g_assertion_message_expr (const char *domain, const char *file, int line, const char *func, const char *expr) G_GNUC_NORETURN; --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --IM9tdXlwtUnPfntgDIHIAr2LihrM4505M Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVVRPpAAoJEKeha0olJ0Nq05MH/1ao0EUBim9MCWFijLf4BYAU Oqdim5b3ZQ7T386upKq2Um966j5pQUn0Grdoghn6IjzYbS7a8gTTYJCoMuqI370N KOYAwATlt1aoRRBqFgpXHXLr8bRr0u+MsHtFU/LtGPuGY1l1JOSetkDrxz8pXGG4 LlXzjjsrAzuZn0sH1pKu+pFTxfXpmuOLIBF7Jxu/xRNmx4U5QkMjegAHPmyJsGCi d/fgyxICSSLw6ub+ZAoateebhSKVemV1+6udp5u6Blna0HSHrj9nP4zM/+X4CFHD DQPwHyg8xC+j0DTIzsxx0AXINBhOEJelZuEvHaIUR9urlB3hHqSr/rt4mA5ypSU= =zIhr -----END PGP SIGNATURE----- --IM9tdXlwtUnPfntgDIHIAr2LihrM4505M--