[Libvir] [PATCH] Avoid "may be used uninitialized" warning.

I've been seeing this on rawhide for a few days: xmconfigtest.c:115: warning: 'old_priv' may be used uninitialized in this function Here's a fix: Avoid "may be used uninitialized" warning. * tests/xmconfigtest.c (testCompareParseXML): Initialize "old_priv". Signed-off-by: Jim Meyering <meyering@redhat.com> --- tests/xmconfigtest.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tests/xmconfigtest.c b/tests/xmconfigtest.c index d66b660..f49ca6c 100644 --- a/tests/xmconfigtest.c +++ b/tests/xmconfigtest.c @@ -51,7 +51,7 @@ static int testCompareParseXML(const char *xmcfg_rel, const char *xml_rel, int ret = -1; virConnectPtr conn; int wrote = MAX_FILE; - void *old_priv; + void *old_priv = NULL; struct _xenUnifiedPrivate priv; char xmcfg[PATH_MAX]; char xml[PATH_MAX]; -- 1.5.4.rc4.1.g1895

Jim Meyering wrote:
I've been seeing this on rawhide for a few days:
xmconfigtest.c:115: warning: 'old_priv' may be used uninitialized in this function
+1. I always compile with --enable-compiler-warnings=fatal. Haven't seen this, but there again Rawhide wasn't working very well for me so I'm back on F8 now. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903
participants (2)
-
Jim Meyering
-
Richard W.M. Jones