From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=48289 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P5KKq-0006BV-Qe for qemu-devel@nongnu.org; Mon, 11 Oct 2010 11:30:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P5JlG-0006nu-0l for qemu-devel@nongnu.org; Mon, 11 Oct 2010 10:53:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51828) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P5JlF-0006mm-QI for qemu-devel@nongnu.org; Mon, 11 Oct 2010 10:53:57 -0400 From: Markus Armbruster Subject: Re: [Qemu-devel] [PATCH 03/12] eepro100: initialize a variable in all cases References: Date: Mon, 11 Oct 2010 16:53:54 +0200 In-Reply-To: (Blue Swirl's message of "Fri, 8 Oct 2010 21:23:44 +0000") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel Blue Swirl writes: > Compiling with GCC 4.6.0 20100925 produced warnings: > /src/qemu/hw/eepro100.c: In function 'eepro100_read4': > /src/qemu/hw/eepro100.c:1351:14: error: 'val' may be used > uninitialized in this function [-Werror=uninitialized] > /src/qemu/hw/eepro100.c: In function 'eepro100_read2': > /src/qemu/hw/eepro100.c:1328:14: error: 'val' may be used > uninitialized in this function [-Werror=uninitialized] > /src/qemu/hw/eepro100.c: In function 'eepro100_read1': > /src/qemu/hw/eepro100.c:1285:13: error: 'val' may be used > uninitialized in this function [-Werror=uninitialized] > > Fix by initializing 'val' at start. I don't like sweeping bugs under the carpet like that. The initial value is used when and only when the emulation is buggy. We doubt it can happen. If we truly believe it can't happen, assert it. If we just doubt it, log it.