qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Weil <weil@mail.berlios.de>
To: Markus Armbruster <armbru@redhat.com>
Cc: Blue Swirl <blauwirbel@gmail.com>, qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 03/12] eepro100: initialize a variable in all	cases
Date: Mon, 11 Oct 2010 18:07:41 +0200	[thread overview]
Message-ID: <4CB3364D.4010707@mail.berlios.de> (raw)
In-Reply-To: <m3ocb093wd.fsf@blackfin.pond.sub.org>

Am 11.10.2010 16:53, schrieb Markus Armbruster:
> Blue Swirl <blauwirbel@gmail.com> 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.

Markus, that patch would only be an intermediate solution
which helps to fix a certain class of compiler warnings.

I already promised to test the code with assertions
and started doing so (see my qemu repository
http://repo.or.cz/w/qemu/ar7.git/history/HEAD:/hw/eepro100.c).
Testing takes some time, so the intermediate solution
can be reasonable.

But nothing will be swept under the carpet!

  reply	other threads:[~2010-10-11 16:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-08 21:23 [Qemu-devel] [PATCH 03/12] eepro100: initialize a variable in all cases Blue Swirl
2010-10-11 14:53 ` Markus Armbruster
2010-10-11 16:07   ` Stefan Weil [this message]
2010-10-11 17:00     ` Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CB3364D.4010707@mail.berlios.de \
    --to=weil@mail.berlios.de \
    --cc=armbru@redhat.com \
    --cc=blauwirbel@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).