From: Markus Armbruster <armbru@redhat.com>
To: Stefan Weil <weil@mail.berlios.de>
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 19:00:31 +0200 [thread overview]
Message-ID: <m3bp70zmts.fsf@blackfin.pond.sub.org> (raw)
In-Reply-To: <4CB3364D.4010707@mail.berlios.de> (Stefan Weil's message of "Mon, 11 Oct 2010 18:07:41 +0200")
Stefan Weil <weil@mail.berlios.de> writes:
> 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!
An intermediate solution could use a comment, but as long as you take
care of the real solution, it's not that important.
prev parent reply other threads:[~2010-10-11 17:00 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
2010-10-11 17:00 ` Markus Armbruster [this message]
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=m3bp70zmts.fsf@blackfin.pond.sub.org \
--to=armbru@redhat.com \
--cc=blauwirbel@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=weil@mail.berlios.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.