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

Daniel P. Berrange berrange at redhat.com
Wed Dec 19 10:21:29 UTC 2012


On Wed, Dec 19, 2012 at 11:14:15AM +0100, Viktor Mihajlovski wrote:
> On 12/18/2012 09:38 PM, Eric Blake wrote:
> >
> >I know this is already pushed, but I think it would fit better under
> >m4/virt-compile-warnings.m4 rather than at the top-level configure.ac.
> >
> since it is early in the release it's not too late to change this,
> although I think - if not in configure.ac - it would rather belong
> to a separate m4/workarounds.m4 or similar ...
> >Potential ouch.  This sets BROKEN_GCC_WLOGICALOP to 1 on all non-gcc
> >compilers.  Then in patch 2/3, you blindly use this condition to request
> >a pragma:
> Really? My expectation is that only a GCC compiler will trigger this
> condition unless there are other compilers producing a compile error
> with strchr(x,y).
> In consequence it is fair to use a GCC pragma, especially as the
> diagnostic pragma is applicable for the failing GCC versions (according
> to the GCC manuals).

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
-- 
|: 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