[libvirt] Non-zero constant warning on RHEL 6.1 with 0.9.7

Eric Blake eblake at redhat.com
Fri Nov 11 21:06:46 UTC 2011


On 11/08/2011 11:46 PM, Justin Clift wrote:
> Hi guys,
> 
> Just checking 0.9.7 on RHEL 6.1 x86_64.  Noticed this when compiling
> with make -j 3:
> 
>     CC     libvirt_lxc-command.o
>   util/buf.c: In function 'virBufferEscape':
>   util/buf.c:469: warning: logical '&&' with non-zero constant will always evaluate as true [-Wlogical-op]
> 
> Obviously not fatal, but it figured someone might want to keep things warning free. :)

This is a bug in gcc, although I'm not sure if anyone has raised a bug
report against the gcc folks yet:
https://www.redhat.com/archives/libvir-list/2011-October/msg00837.html

I'm open to suggestions on how to work around it; perhaps we just need
to disable -Wlogical-op if glibc's headers are turning on the optimized
strchr (is that -D_FORTIFY_SOURCE that does it?) :(

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20111111/03873db5/attachment-0001.sig>


More information about the libvir-list mailing list