From fe074860b5daaa6e0943a92209c999bf476c0ce6 Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Wed, 1 Aug 2012 12:46:49 +0100 Subject: 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 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 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. Signed-off-by: Olaf Hering Acked-by: Ian Campbell Committed-by: Ian Campbell --- tools/libxl/libxl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 00ddc0ec80..726a70ebb0 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -1590,6 +1590,7 @@ static int libxl__primary_console_find(libxl_ctx *ctx, uint32_t domid_vm, case LIBXL_DOMAIN_TYPE_INVALID: rc = ERROR_INVAL; goto out; + default: abort(); } } -- cgit v1.2.3