[libvirt] [PATCH] build: silence a clang false positive

Eric Blake eblake at redhat.com
Wed May 5 20:47:44 UTC 2010


On 05/05/2010 01:59 PM, Jim Meyering wrote:
> Eric Blake wrote:
>> * src/qemu/qemu_monitor.c (qemuMonitorIOWriteWithFD): Work around
>> recent clang shortcoming in analysis.
> ...
>> diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
> ...
>>      cmsg = CMSG_FIRSTHDR(&msg);
>> +    /* Some static analyzers, like clang 2.6-0.6.pre2, fail to see
>> +       that our use of CMSG_FIRSTHDR will not return NULL.  */
>> +    sa_assert(cmsg);
>>      cmsg->cmsg_len = CMSG_LEN(sizeof(int));
>>      cmsg->cmsg_level = SOL_SOCKET;
>>      cmsg->cmsg_type = SCM_RIGHTS;
> 
> ACK.

Thanks; pushed.

> Note that with clang-2.7, which is in rawhide, this sa_assert is not needed.

Fair enough, but it will be a few months before that version propagates
into common usage :)

-- 
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: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20100505/6ea8526d/attachment-0001.sig>


More information about the libvir-list mailing list