Re: Non-zero constant warning on RHEL 6.1 with 0.9.7

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/15/2011 04:34 AM, Stefan Berger wrote:
> What about this here:
> 
> --- a/src/util/buf.c
> +++ b/src/util/buf.c
> @@ -466,7 +466,11 @@ virBufferEscape(virBufferPtr buf, const char
> *toescape,
>      cur = str;
>      out = escaped;
>      while (*cur != 0) {
> -        if (strchr(toescape, *cur))
> +        /* strchr work-around for gcc 4.3 & 4.4 bug with -Wlogical-op
> +         * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36513
> +         */
> +        char needle[2] = { *cur, 0 };
> +        if (strstr(toescape, needle))
>              *out++ = '\\';
>          *out++ = *cur;
>          cur++;

ACK.  And I finally reproduced the issue with gcc 4.4.6, as well as
confirmed that gcc 4.6.2 is immune; it involves both -O1 (or greater)
and -Wlogical-op at the same time.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]