qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2] libvixl: a64: Skip "-Wunused-variable" for g


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v2] libvixl: a64: Skip "-Wunused-variable" for gcc 5.0.0 or higher
Date: Mon, 13 Oct 2014 08:59:46 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1

On 10/12/2014 01:50 AM, Peter Maydell wrote:
> On 12 October 2014 01:32, Chen Gang <address@hidden> wrote:
>> On 10/12/14 5:25, Peter Maydell wrote:
>>> Some other approaches to this that would confine the
>>> fix to the makefiles rather than requiring us to modify
>>> the vixl source itself:
>>>  a) add a -Wno- option for the affected .o files
>>
>> It is one way, but may have effect with gcc 4 version, and also it is
>> effect with the whole file which is wider than current way.
>>
>>>  b) use -isystem rather than -I to include the libvixl
>>>     directory on the include path
>>>
>>
>> It sounds good to me, although for me, it is not related with current
>> issue.
> 
> -isystem disables a bunch of gcc warnings automatically,
> which is why I suggested it. I'm not overall sure it's
> a great idea though.

-isystem is a heavy hammer, affecting the entire compilation.  Better
might be just marking the ONE header as being a system header (silence
various warnings caused by just that header, while still letting the
rest of the compilation warn).  If the header comes from third-party
sources, this is probably the best approach.  It is done by adding:

#if __GNUC__ >= 3
#pragma GCC system_header
#endif

to the header that would otherwise trigger warnings.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]