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

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

 



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.
Note that with clang-2.7, which is in rawhide, this sa_assert is not needed.

--
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]