[libvirt] [PATCH v2] build: silence a clang warning in virsh.c

Eric Blake eblake at redhat.com
Mon Nov 18 16:01:28 UTC 2013


On 11/18/2013 08:39 AM, Ryota Ozaki wrote:
> This patch shuts up the following warning of clang
> on Mac OS X:

Not just clang, but also gcc.

> 
>   virsh.c:2761:22: error: assigning to 'char *' from 'const char [6]' discards qualifiers
>       [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
>       rl_readline_name = "virsh";
>                        ^ ~~~~~~~
> 
> The warning happens because rl_readline_name on Mac OS X is still
> 'char *', while it is 'const char *' on most platforms.

This is the real bug we are working around, not clang.

What version of libreadline is installed on your platform?  I'm okay
with the patch, but not the commit message - I want to accurately report
that WHY we are tweaking things is to work around a bug in older
libreadline (which has nothing to do with which compiler is used, and
everything to do with the buggy older header).

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

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


More information about the libvir-list mailing list