On 09/06/2014 07:42 PM, Dylan Cali wrote:
> On Sat, Sep 6, 2014 at 7:30 PM, Paul Eggert <egg...@cs.ucla.edu> 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

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to