]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
build: silence a clang false positive
authorEric Blake <eblake@redhat.com>
Wed, 5 May 2010 17:14:54 +0000 (11:14 -0600)
committerEric Blake <eblake@redhat.com>
Wed, 5 May 2010 20:46:41 +0000 (14:46 -0600)
* src/qemu/qemu_monitor.c (qemuMonitorIOWriteWithFD): Work around
recent clang shortcoming in analysis.

src/qemu/qemu_monitor.c

index 443d2167b107ae048bbf82bf3f877e7e36585072..abf13383a8020f06dcbeecacedcb1f6a090826f5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * qemu_monitor.c: interaction with QEMU monitor console
  *
- * Copyright (C) 2006-2009 Red Hat, Inc.
+ * Copyright (C) 2006-2010 Red Hat, Inc.
  * Copyright (C) 2006 Daniel P. Berrange
  *
  * This library is free software; you can redistribute it and/or
@@ -374,6 +374,9 @@ qemuMonitorIOWriteWithFD(qemuMonitorPtr mon,
     msg.msg_controllen = sizeof(control);
 
     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;