From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53448) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHiZL-0000Dc-L3 for qemu-devel@nongnu.org; Thu, 05 Sep 2013 19:02:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VHiZG-0003iA-63 for qemu-devel@nongnu.org; Thu, 05 Sep 2013 19:02:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39964) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHiZF-0003hx-VS for qemu-devel@nongnu.org; Thu, 05 Sep 2013 19:02:26 -0400 Message-ID: <52290D7E.7020003@redhat.com> Date: Thu, 05 Sep 2013 17:02:22 -0600 From: Eric Blake MIME-Version: 1.0 References: <20130905222853.4097.42724.stgit@bling.home> <522907AF.9040808@redhat.com> <1378420917.3246.271.camel@ul30vt.home> In-Reply-To: <1378420917.3246.271.camel@ul30vt.home> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="9UAMocqIIvg46Ii1KBHQv2PsrTfsTgPOX" Subject: Re: [Qemu-devel] [PATCH] vfio-pci: Cleanup error_reports List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Williamson Cc: qemu-devel@nongnu.org, Anthony Liguori This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --9UAMocqIIvg46Ii1KBHQv2PsrTfsTgPOX Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 09/05/2013 04:41 PM, Alex Williamson wrote: >>> /* This can fail for an old kernel or legacy PCI dev */ >>> - DPRINTF("VFIO_DEVICE_GET_IRQ_INFO failure ret=3D%d\n", ret);= >>> + DPRINTF("VFIO_DEVICE_GET_IRQ_INFO failure: %m\n"); >> >> %m is a glibc extension, and does not exist on all platforms. You >> should probably not make this change. >=20 > It's not the only instance of %m in this file and, IIRC, was previously= > suggested by Anthony. Are we banning %m now? Thanks, This particular usage is protected by DPRINTF, so as long as DPRINTF is disabled, it won't break compilation on non-glibc systems. And in thinking about it, this _particular_ file is Linux-only (vfio is a Linux kernel concept not available on other OS), so for _this_ file, you are assured that %m will always be interpreted by glibc (or its derivatives) and thus have defined extension behavior. So I retract any complaint about this patch. But I suspect that if we start encouraging the use of %m, we will eventually proliferate it into other files that are not Linux-only, and then run into compilers that warn about unknown format specifiers for a given platform (such as on BSD systems), or worse, silent compilation but then output that triggers undefined behavior if the printf is ever actually used at runtime (typically you'd get a literal %m instead of the intended strerror() text which merely makes the trace less useful, but undefined behavior also permits a libc that abort()s on seeing %m...)= --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --9UAMocqIIvg46Ii1KBHQv2PsrTfsTgPOX Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJSKQ1+AAoJEKeha0olJ0NqAzQH/3tJBW6eC6Oz/b4u5jhfKw0B JOvw93YA5axT65RHnaL96QJ8wqp6LUvHsYxQ1ZBqHwAme1vmewTkJxJLJWSgkvYt UqV8ctXU66ddjIyijAgDNd4sAW7TWsbsUoCQKSCe7VuqJQDMfxcRDVbqssIcK1RH ONdbVo9nlrJPL1Jez3MakI+cyBcivWZ9ibFAZ3rfor3gN+1ZC+1ThasaNwUkJhnk 4hrJepBAR+lk5OAv4IC3woXsm1ExI6pgAPqqzsgV95E6kuvunKyz+b0S9FGf/UL9 5KWXEvoNG7rAC6XiVSSedZHWFpnVD31te/1V1HVMOuqI752OTyPjcJ1hdhxjFY8= =ZDol -----END PGP SIGNATURE----- --9UAMocqIIvg46Ii1KBHQv2PsrTfsTgPOX--