From fb9da19e90075a12aa84e6507e78a5d1efa6101c Mon Sep 17 00:00:00 2001 From: Roman Bogorodskiy Date: Tue, 28 Apr 2015 08:26:44 +0400 Subject: [PATCH] conf: explicitly initialize 'cpumask' variable Build with clang fails with: CC conf/libvirt_conf_la-domain_conf.lo conf/domain_conf.c:13377:9: error: variable 'cpumask' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized] if (!(tmp = virXMLPropString(node, "cpuset"))) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ and many other similar errors regarding the 'cpuset' variable. Fix by explicitly initializing it with NULL. --- src/conf/domain_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 0b187205d5..957221b72b 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -13342,7 +13342,7 @@ virDomainIOThreadPinDefParseXML(xmlNodePtr node, { int ret = -1; virDomainIOThreadIDDefPtr iothrid; - virBitmapPtr cpumask; + virBitmapPtr cpumask = NULL; xmlNodePtr oldnode = ctxt->node; unsigned int iothreadid; char *tmp = NULL; -- GitLab