[libvirt] [PATCHv3 1/3] build: Check for broken GCC -Wlogical-op in configure

Daniel P. Berrange berrange at redhat.com
Wed Dec 19 12:29:32 UTC 2012


On Wed, Dec 19, 2012 at 01:05:42PM +0100, Viktor Mihajlovski wrote:
> On 12/19/2012 11:21 AM, Daniel P. Berrange wrote:
> >On Wed, Dec 19, 2012 at 11:14:15AM +0100, Viktor Mihajlovski wrote:
> >
> >I think Eric means that on non-GCC this code:
> >
> ># if BROKEN_GCC_WLOGICALOP
> >#  pragma GCC diagnostic ignored "-Wlogical-op"
> ># endif
> >
> >
> >will cause the compiler to complain "Unknown pragma GCC diagnostic..."
> >since obviously non-GCC compilers don't understand GCC pragmas
> >
> >Daniel
> >
> 
> I understood that part. My statement is that BROKEN_GCC_WLOGICALOP will
> not be defined if configure was run on a system with non-GCC compiler.
> Unless I oversaw something fundamental ... which I will never rule out.

I think it depends on what the compiler does with unknown -W flags.
In the configure test you created, there are 2 possible reasons
why the TRY_COMPILE can fail

 - Using GCC with a broken -Wlogical-op impl
 - Compiler which doesn't understand -Wlogical-op at all and treats
   this is a fatal error

I think the solution here is to move the check into
virt-compiler-warnings.m4 and only look for a broken
GCC, if we have already validated that '-Wlogical-op'
is supported by the compiler

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list