All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: 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 16:53:54 +0200	[thread overview]
Message-ID: <m3ocb093wd.fsf@blackfin.pond.sub.org> (raw)
In-Reply-To: <AANLkTim-7Pj=S+pCDD-knA=usWoCWZjVxZBm9ughfVYZ@mail.gmail.com> (Blue Swirl's message of "Fri, 8 Oct 2010 21:23:44 +0000")

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.

  reply	other threads:[~2010-10-11 15:30 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 [this message]
2010-10-11 16:07   ` Stefan Weil
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=m3ocb093wd.fsf@blackfin.pond.sub.org \
    --to=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 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.