From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50273) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTD2c-0007LN-GS for qemu-devel@nongnu.org; Tue, 09 Feb 2016 13:29:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aTD2b-0005Wx-83 for qemu-devel@nongnu.org; Tue, 09 Feb 2016 13:29:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44683) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTD2b-0005Wb-0L for qemu-devel@nongnu.org; Tue, 09 Feb 2016 13:29:33 -0500 References: <1455031511-23684-1-git-send-email-peter.maydell@linaro.org> <56BA0F09.8060302@redhat.com> <56BA0F98.2040300@redhat.com> <56BA1D97.5040705@redhat.com> <56BA1F5B.3050903@redhat.com> From: Eric Blake Message-ID: <56BA300B.3060504@redhat.com> Date: Tue, 9 Feb 2016 11:29:31 -0700 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Il3BCXODhXm6vtvUOKdmH1ru7KSfwXiBP" Subject: Re: [Qemu-devel] [PATCH 00/14] More #include cleanups List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Paolo Bonzini , Richard Henderson , QEMU Developers , Patch Tracking This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Il3BCXODhXm6vtvUOKdmH1ru7KSfwXiBP Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 02/09/2016 11:04 AM, Peter Maydell wrote: >>> So _something_ in osdep.h is redefining 'inline' with disastrous effe= cts >>> to C++. >> >> This hack seems to fix things; but I'm not enough of a C++ expert to >> know if it is the best fix. >> >> diff --git i/include/qemu/compiler.h w/include/qemu/compiler.h >> index d22eb01..d50b806 100644 >> --- i/include/qemu/compiler.h >> +++ w/include/qemu/compiler.h >> @@ -77,6 +77,7 @@ >> #define typeof_field(type, field) typeof(((type *)0)->field) >> #define type_check(t1,t2) ((t1*)0 - (t2*)0) >> >> +#ifndef __cplusplus >> #ifndef always_inline >> #if !((__GNUC__ < 3) || defined(__APPLE__)) >> #ifdef __OPTIMIZE__ >> @@ -88,6 +89,7 @@ >> #undef inline >> #define inline always_inline >> #endif >> +#endif >=20 > Ah, well tracked down. I guess my system headers don't happen > to rely on this bit of inline syntax. >=20 > Next question -- do we really need to redefine "inline" to > always_inline at all, in C or C++? (cc'd a few people who might > have an opinion). My instinct is to say "don't do this, just > trust the compiler to decide whether to bother inlining". If ripping that chunk out doesn't hurt anything, I'm all in favor of it. Redefining 'inline' tends to hurt more than it prevents (and while there IS the case of C89 vs. C99 vs. GNU having different semantics for 'static inline', those are best worked around by writing and consistently using wrapper macros such as 'STATIC_INLINE', not redefining 'inline' itself). >=20 > Git blame says this was added back in commit df2542c737ea2 in > 2007, with the rationale "To avoid discarded inlining bug"... The date alone says it may be time to quit doing it :) --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --Il3BCXODhXm6vtvUOKdmH1ru7KSfwXiBP 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/ iQEcBAEBCAAGBQJWujALAAoJEKeha0olJ0NqhhsH/jBxABmHHKbntQwZKjscuQdF UrFE+DRmVgeOfhKqjP8f4PAfha4ws1INeC22UlHtOaw7T1mP96dVQmHRR9MxeYFu kD8Adt5pQLSxntnYlg5aKMC3TivvthYPmF7vVU2zNDpILzFEjIcsqibUeSpD0z9P iL/K53efBYBQ9stSWILB/BKcr7r7JE0Y+dogZU27+G7ogglvMImny5DrwaBko6CL SmvaYQI42jxxi2PgIHwyHiQ7QoDU6t7SdPcXEx5ouxilLAQMT6FCG4mbIeidG/Oa omZI0/fD0deA8zB44tn9pVScbn05TFwg2tjHZjHvZYdINnnPKnBWcgUnSz8bwsU= =tYDe -----END PGP SIGNATURE----- --Il3BCXODhXm6vtvUOKdmH1ru7KSfwXiBP--