From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35880) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYyur-0003me-FR for qemu-devel@nongnu.org; Thu, 25 Feb 2016 11:37:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aYyum-00009d-FW for qemu-devel@nongnu.org; Thu, 25 Feb 2016 11:37:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39498) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYyum-00009Z-9T for qemu-devel@nongnu.org; Thu, 25 Feb 2016 11:37:20 -0500 References: <1456414292-55363-1-git-send-email-emaste@freebsd.org> <56CF2BCE.6090504@redhat.com> <20160225163202.GI10515@redhat.com> From: Eric Blake Message-ID: <56CF2DBE.4070708@redhat.com> Date: Thu, 25 Feb 2016 09:37:18 -0700 MIME-Version: 1.0 In-Reply-To: <20160225163202.GI10515@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ePjWgtwTFAuLaatEcheCWBllV2P1jDINg" Subject: Re: [Qemu-devel] [PATCH] io: fix build on FreeBSD List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" Cc: Ed Maste , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ePjWgtwTFAuLaatEcheCWBllV2P1jDINg Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 02/25/2016 09:32 AM, Daniel P. Berrange wrote: >>> + if ( >>> +#ifdef EAI_ADDRFAMILY >>> + gaierr =3D=3D EAI_ADDRFAMILY || >>> +#endif >>> gaierr =3D=3D EAI_FAMILY || >> >> I'm not the biggest-fan of mid-expression #ifdefs. Can we rewrite this= >> to look more like: >> >> #ifndef EAI_ADDRFAMILY >> #define EAI_ADDRFAMILY EAI_FAMILY >> #endif >> >> and leave the conditional expression unchanged? >=20 > I think that'll cause gcc 6 to whine about you checking the same > value twice in the conditional, like how it complains that EWOULDBLOCK > and EAGAIN are the same. Oh, right. That's annoying. What about: #ifndef EAI_ADDRFAMILY #define EAI_ADDRFAMILY 0 #endif if ((EAI_ADDRFAMILY && gaierr =3D=3D EAIADDRFAMILY) || gaierr =3D=3D EAI_FAMILY... to shut up gcc 6, while still hoisting the preprocessor logic outside of the expression? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --ePjWgtwTFAuLaatEcheCWBllV2P1jDINg 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/ iQEcBAEBCAAGBQJWzy2+AAoJEKeha0olJ0NqN2YH/3RLgYSo2TrxwTNlDkm5lckf j0zxsqdfMMbG2sm86CCJz6UrkR+lySxxcd5Yfdw24KXdivK9tKe+sKrNSME/Fl/q uPp+/bWr+PU8aESGjyQ745zepyElXP0pXN2QwRcDK40EHGCuavs7qqt7KDIWjoNu BWeFU/Gz7HSYFnQv4aGKBXdXVkDP5v+uYSOsGS2Vu0Uf8jo+dvUe7Iv/Hf52rWuo x5dCoLri3UJtX575xsQXM49sum2xuaWT18uOWFKQtWNxN52ZoA4A77W8uYJ15pf0 URrX70+U2zZkNAvCQE3bD++X/12qJwVRl2B+yv0+0q2jHeE3uukuaNKPhAH+5Ug= =gcBa -----END PGP SIGNATURE----- --ePjWgtwTFAuLaatEcheCWBllV2P1jDINg--