[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] build: Don't redefine 'inline'
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH] build: Don't redefine 'inline' |
Date: |
Fri, 12 Feb 2016 08:49:04 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 |
On 02/12/2016 06:24 AM, Peter Maydell wrote:
> On 9 February 2016 at 18:49, Eric Blake <address@hidden> wrote:
>> Actively redefining 'inline' is wrong for C++, where gcc has an
>> extension 'inline namespace' which fails to compile if the
>> keyword 'inline' is replaced by a macro expansion. This will
>> matter once we start to include "qemu/osdep.h" first from C++
>> files, depending also on whether the system headers are new
>> enough to be using the gcc extension.
>>
>> But rather than just guard things by __cplusplus, let's look at
>> the overall picture. Commit df2542c737ea2 in 2007 defined 'inline'
>> to the gcc attribute __always_inline__, with the rationale "To
>> avoid discarded inlining bug". But compilers have improved since
>> then, and we are probably better off trusting the compiler rather
>> than trying to force its hand.
>>
>> So just nuke our craziness.
>>
>> Signed-off-by: Eric Blake <address@hidden>
>
> Reviewed-by: Peter Maydell <address@hidden>
>
> (and tested that it passes my usual merge build tests).
>
> Does this patch suffice to get your system to build all
> my clean-includes patches?
Yes.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature