libxl: fix unitialized variables in libxl__primary_console_find
PATCH 1/1 libxl: fix unitialized variables in libxl__primary_console_find
# HG changeset patch
# User Olaf Hering <[email protected]>
# Date 1343662357 -7200
# Node ID db8adce4f09307a90f96103f7fd67efa97fc9ac0
# Parent cf0e661cb321b1c898c9008dc17ba21db434c976
libxl: fix unitialized variables in libxl__primary_console_find
gcc 4.5 as shipped with openSuSE 11.4 does not recognize the case of LIBXL_DOMAIN_TYPE_INVALID properly:
cc1: warnings being treated as errorslibxl.c: In function 'libxl_primary_console_exec':
libxl.c:1408:14: error: 'domid' may be used uninitialized in this function libxl.c:1409:9: error: 'cons_num' may be used uninitialized in this function libxl.c:1410:24: error: 'type' may be used uninitialized in this function libxl.c: In function 'libxl_primary_console_get_tty':
libxl.c:1421:14: error: 'domid' may be used uninitialized in this function libxl.c:1422:9: error: 'cons_num' may be used uninitialized in this function libxl.c:1423:24: error: 'type' may be used uninitialized in this function make[3]: *** [libxl.o] Error 1
Fix this by adding a default case.
tools/libxl/libxl.c +1 -0
@@ -1590,6 +1590,7 @@ static int libxl__primary_console_find(lcase LIBXL_DOMAIN_TYPE_INVALID : rc =ERROR_INVAL ; goto out; +default :abort (); } }
Quoted 21 lines · Olaf Hering
# HG changeset patch
# User Olaf Hering <[email protected]>
# Date 1343662357 -7200
# Node IDdb8adce4f09307a90f96103f7fd67efa97fc9ac0
# Parentcf0e661cb321b1c898c9008dc17ba21db434c976
libxl: fix unitialized variables inlibxl__primary_console_findgcc 4.5 as shipped with openSuSE 11.4 does not recognize the case of
LIBXL_DOMAIN_TYPE_INVALIDproperly:cc1: warnings being treated as errors
libxl.c: In function 'libxl_primary_console_exec':
libxl.c:1408:14: error: 'domid' may be used uninitialized in this function libxl.c:1409:9: error: 'cons_num' may be used uninitialized in this function libxl.c:1410:24: error: 'type' may be used uninitialized in this functionlibxl.c: In function 'libxl_primary_console_get_tty':
libxl.c:1421:14: error: 'domid' may be used uninitialized in this function libxl.c:1422:9: error: 'cons_num' may be used uninitialized in this function libxl.c:1423:24: error: 'type' may be used uninitialized in this function make[3]: *** [libxl.o] Error 1
Quoted 3 lines
Fix this by adding a default case.
Signed-off-by Olaf Hering <[email protected]>
Applied, thanks.
Quoted 17 lines
diff -r
cf0e661cb321-rdb8adce4f093tools/libxl/libxl.ctools/libxl/libxl.c +1
-0@@ -1590,6 +1590,7 @@ static int libxl__primary_console_find(lcase LIBXL_DOMAIN_TYPE_INVALID : rc =ERROR_INVAL ; goto out; +default :abort (); } }_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel