[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: compile warnings when including avltree-list and gcc-warnings is ena
From: |
Eric Blake |
Subject: |
Re: compile warnings when including avltree-list and gcc-warnings is enabled |
Date: |
Mon, 08 Sep 2014 08:27:28 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0 |
On 09/06/2014 07:42 PM, Dylan Cali wrote:
> On Sat, Sep 6, 2014 at 7:30 PM, Paul Eggert <address@hidden> wrote:
>> On second thought this doesn't look wise, as the function is not expected to
>> be exported to ordinary clients, only to the test cases. So let's leave the
>> .h file alone, and put a declaration in the .c file instead.
>>
>> I suppose a pragma is the way to silence the unwanted diagnostics, yes.
>
> Updated patch attached. I moved the declaration to the .c file and
> added the warning suppression for just that function. Everything
> builds without issue now.
>
>
> +
> +/* GCC warns that check_invariants has no effect, but it does. Ignore
> + the false positive. */
> +#pragma GCC diagnostic push
> +#pragma GCC diagnostic ignored "-Wunused-value"
Does this work for all supported versions of gcc? Or do you need to make
it conditional on new enough gcc (it's okay if warnings have to be
disabled to compile with older gcc, but not okay if the way to disable
warnings for newer gcc causes compilation failure in older gcc).
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- compile warnings when including avltree-list and gcc-warnings is enabled, Dylan Cali, 2014/09/05
- Re: compile warnings when including avltree-list and gcc-warnings is enabled, Paul Eggert, 2014/09/05
- Re: compile warnings when including avltree-list and gcc-warnings is enabled, Dylan Cali, 2014/09/05
- Re: compile warnings when including avltree-list and gcc-warnings is enabled, Dylan Cali, 2014/09/06
- Re: compile warnings when including avltree-list and gcc-warnings is enabled, Paul Eggert, 2014/09/06
- Re: compile warnings when including avltree-list and gcc-warnings is enabled, Dylan Cali, 2014/09/06
- Re: compile warnings when including avltree-list and gcc-warnings is enabled,
Eric Blake <=
- Re: compile warnings when including avltree-list and gcc-warnings is enabled, Dylan Cali, 2014/09/08
- Re: compile warnings when including avltree-list and gcc-warnings is enabled, Dylan Cali, 2014/09/08
- Re: compile warnings when including avltree-list and gcc-warnings is enabled, Pádraig Brady, 2014/09/16