On Fri, Jan 16, 2015 at 02:47:42PM +0000, Ian Campbell wrote:
> On Fri, 2015-01-16 at 14:19 +0000, Daniel P. Berrange wrote:
> > On Fri, Jan 16, 2015 at 01:58:27PM +0000, Ian Campbell wrote:
> > > Hello,
> > > 
> > > On Tue, 2015-01-13 at 17:00 +0000, Daniel P. Berrange wrote:
> > > > +#  define VIR_WARNINGS_NO_PRINTF \
> > > > +    _Pragma ("GCC diagnostic push") \
> > > > +    _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=format\"")
> > > 
> > > Xen automated tests are failing to build on all architectures with:
> > > 
> > >         util/virxml.c: In function 'catchRNGError':
> > >         util/virxml.c:1094:9: error: unknown option after '#pragma GCC 
> > > diagnostic' kind [-Werror=pragmas]
> > > 
> > > which I think must be down to one of these additions.
> > > 
> > > (helpful of gcc not to print the unknown option in question!)
> > > 
> > > test overview:
> > > http://www.chiark.greenend.org.uk/~xensrcts/logs/33443/
> > > specific failure log:
> > > http://www.chiark.greenend.org.uk/~xensrcts/logs/33443/build-amd64-libvirt/5.ts-libvirt-build.log
> > > 
> > > We use Debian Wheezy's gcc, which is 4.6.3 AFAIK.
> > 
> > The configure logs show
> > 
> > checking whether C compiler handles -Wsuggest-attribute=const... yes
> > checking whether C compiler handles -Wsuggest-attribute=format... no
> > checking whether C compiler handles -Wsuggest-attribute=noreturn... yes
> > checking whether C compiler handles -Wsuggest-attribute=pure... yes
> > 
> > So, can someone with a Debian machine check if it helps to modify
> > 
> >     _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=format\"")
> > 
> > To be just
> > 
> >     _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute\"")
> 
> I'm afraid it doesn't seem to. Specifically:
>         diff --git a/src/internal.h b/src/internal.h
>         index 9855c49..508f8b5 100644
>         --- a/src/internal.h
>         +++ b/src/internal.h
>         @@ -236,7 +236,7 @@
>              _Pragma ("GCC diagnostic ignored \"-Wcast-align\"")
>          #  define VIR_WARNINGS_NO_PRINTF \
>              _Pragma ("GCC diagnostic push") \
>         -    _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=format\"")
>         +    _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute\"")
>          
>          #  define VIR_WARNINGS_RESET \
>              _Pragma ("GCC diagnostic pop")
>         
> Didn't help.
> 
> According to
> https://gcc.gnu.org/onlinedocs/gcc-4.6.3/gcc/Warning-Options.html#Warning-Options
>  the valid -Wsuggest-attributes=FOO in that version are pure const and 
> noreturn.
> 
> =format seems to have arrived in 4.8, FWIW.

I just copied you on an alternative patch that would hopefully fix
it - I explicitly check if suggest-attribute=format exists in the
gcc version used.

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

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

Reply via email to