From: Ian Campbell Subject: Re: [PATCH] libxl: fix unitialized variables in libxl__primary_console_find Date: Tue, 24 Jul 2012 09:45:41 +0100 Message-ID: <1343119541.5797.95.camel@zakaz.uk.xensource.com> References: <5668cb98eebb0a27530c.1341404264@probook.site> <1343040673.4091.16.camel@zakaz.uk.xensource.com> <20120723134348.GA32746@aepfle.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20120723134348.GA32746@aepfle.de> 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.xensource.com" , Ian Jackson List-Id: xen-devel@lists.xenproject.org On Mon, 2012-07-23 at 14:43 +0100, Olaf Hering wrote: > On Mon, Jul 23, Ian Campbell wrote: > > > On Wed, 2012-07-04 at 13:17 +0100, Olaf Hering wrote: > > > # HG changeset patch > > > # User Olaf Hering > > > # Date 1341404234 -7200 > > > # Node ID 5668cb98eebb0a27530c8b52f3ae8cce87d3b863 > > > # Parent 42f76d536b116d2ebad1b6705ae51ecd171d2581 > > > libxl: fix unitialized variables in libxl__primary_console_find > > > > Olaf, > > > > I have a vague recollection of some discussion of this and a different > > fix but I can't actually find any such discussion and the patch is still > > in my queue. Is this still needed? > > Yes. > > > > gcc 4.5 as shipped with openSuSE 11.4 does not recognize the case of > > > LIBXL_DOMAIN_TYPE_INVALID properly: > > > > That's kind of lame of gcc... > > > > I wonder if default: abort() might be more appropriate (I'm not sure > > what our policy here ended up being). > > libxl__domain_type is a simple and internal function. Perhaps a comment > about why a 'default' case exists is enough. I think we've mostly been considering that the "abort()" is in itself enough documentation that this should never happen. Ian.