From: Ian Campbell Subject: Re: [PATCH] libxl: fix unitialized variables in libxl__primary_console_find Date: Wed, 1 Aug 2012 12:47:29 +0100 Message-ID: <1343821649.27221.79.camel@zakaz.uk.xensource.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Olaf Hering Cc: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Mon, 2012-07-30 at 17:35 +0100, Olaf Hering wrote: > # HG changeset patch > # User Olaf Hering > # 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 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 Applied, thanks. > > diff -r cf0e661cb321 -r db8adce4f093 tools/libxl/libxl.c > --- a/tools/libxl/libxl.c > +++ b/tools/libxl/libxl.c > @@ -1590,6 +1590,7 @@ static int libxl__primary_console_find(l > case LIBXL_DOMAIN_TYPE_INVALID: > rc = ERROR_INVAL; > goto out; > + default: abort(); > } > } > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel