From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56538) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TC0RF-0003ac-Dg for qemu-devel@nongnu.org; Wed, 12 Sep 2012 23:50:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TC0RE-0008Uf-2Y for qemu-devel@nongnu.org; Wed, 12 Sep 2012 23:50:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:14024) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TC0RD-0008UU-QD for qemu-devel@nongnu.org; Wed, 12 Sep 2012 23:49:59 -0400 Message-ID: <505157CD.2080703@redhat.com> Date: Wed, 12 Sep 2012 21:49:33 -0600 From: Eric Blake MIME-Version: 1.0 References: <1347265586-17698-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1347265586-17698-3-git-send-email-xiawenc@linux.vnet.ibm.com> <504FC0B1.7080903@redhat.com> <504FFC05.5070601@linux.vnet.ibm.com> <5050874B.4050505@redhat.com> <505151D8.9030300@linux.vnet.ibm.com> <50515406.8020203@redhat.com> In-Reply-To: <50515406.8020203@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig962C5FF6643393F5C70DFD1F" Subject: Re: [Qemu-devel] [PATCH V2 2/6] libqblock type and structure defines List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: kwolf@redhat.com, aliguori@us.ibm.com, stefanha@gmail.com, qemu-devel@nongnu.org, Blue Swirl , pbonzini@redhat.com, Wenchao Xia This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig962C5FF6643393F5C70DFD1F Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 09/12/2012 09:33 PM, Eric Blake wrote: >> OK ,then I think >> #if __GNUC__ >=3D 4 >> .... >> #else >> [warn name space pollution may happen] >> #endif >> would be better. >=20 > It may be shorter, but it is definitely not better, at least not in the= > current context of qemu. Using the short form will fail a -Werror > build, unless you also write a patch to qemu's configure to quit > supplying -Wundef during builds. But as touching configure has a bigge= r > impact to the overall qemu project, you're going to need a lot more > buy-in from other developers that -Wundef is not helping qemu gain any > portability, and that it is safe to ditch it (or get enough > counter-arguments from other developers why qemu insists on the > anachronistic style enforced by -Wundef, at which point you must comply= > and use the longer form). On second thought, this _particular_ usage will never fail a -Wundef -Werror build, precisely because -Wundef is a gcc warning, which impies the warning is only ever useful in the same scenarios that the __GNUC__ macro is always defined (that is, __GNUC__ is undefined only on a non-gcc compiler, but what non-gcc compiler supports -Wundef -Werror?). But why should this line be the one exemption to the rules? Either qemu insists on the -Wundef style of coding (and you should use the long form to conform to that style, on the off-chance that someone ever wants to port to a non-gcc compiler, even in this one place where gcc can't warn you about the violation of that style), or we should change the qemu style (at which point, the short form is nicer here, but it also implies the potential for cleaning up lots of other places to also use short forms and rely on preprocessor 0 computation). --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enig962C5FF6643393F5C70DFD1F 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.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iQEcBAEBCAAGBQJQUVfNAAoJEKeha0olJ0Nqm4QH/jKE+hl72WaZM7qYA3CPCHvK 5KEd46ZjaJz7irFrEHbYvYRZ/YqVdZT2e5oQQFebjyWrTa8OISWmYpEhiAw4lhPt Q6F3LSO++TEyPBTreBScqjw21P2/LQZPyBFOVWyAq9cCY/LpmnpGD3BEpelR3WHc 1LvTGVTxWlVyQt6s3X9Be4SIkuPN0X5HTx+MVJ4h0AMh/RbrcZShE+3CzY3g0omY yVqzgXdee0jCKwGtkq+2317fCMG30jWPl4235t8oRZBKVG5l1vNOWa2RsW8iTrnO IPIQMu6YTrOkfGNdQAfBK0oWPXdErfNEkcTsz9HJuuhwwxJge1U+Y3BoWZijZA8= =5I27 -----END PGP SIGNATURE----- --------------enig962C5FF6643393F5C70DFD1F--