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

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



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 redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


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