From: Peter Maydell <peter.maydell@linaro.org>
To: Stefan Weil <weil@mail.berlios.de>
Cc: Riku Voipio <riku.voipio@iki.fi>,
QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] linux-user: Set uninitialized local variable and disable unused code
Date: Sat, 7 May 2011 22:50:23 +0100 [thread overview]
Message-ID: <BANLkTim2kZtmUmj-QFdLE+TKYx0wQ-sakg@mail.gmail.com> (raw)
In-Reply-To: <1304801048-26036-1-git-send-email-weil@mail.berlios.de>
On 7 May 2011 21:44, Stefan Weil <weil@mail.berlios.de> wrote:
> cppcheck report:
> linux-user/signal.c:2057: error: Uninitialized variable: err
>
> cppcheck is correct. Setting err = 0 is a workaround to avoid
> random results and the cppcheck warning.
>
> Function restore_fpu_state is currently unused, so I disabled the code.
(This is in the SPARC-specific part of that file, to save other
people having to dig through for the relevant ifdef; maybe we
should split it up rather than having every target cpu have
its own huge ifdef-guarded section...)
I'm not sure there's much point in putting in the "err=0"
change as well as ifdef'ing out the function, is there? The
code is clearly broken and whoever fixes it will end up
doing something similar then.
Obviously it would be nicer to actually fix the code, since
at the moment it means if your SPARC binary uses floating
point in a signal handler it can trash registers. Luckily
given where qemu takes guest signals it's quite hard to
actually provoke visible problems with this.
I'm surprised gcc doesn't complain about this.
-- PMM
prev parent reply other threads:[~2011-05-07 21:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-07 20:44 [Qemu-devel] [PATCH] linux-user: Set uninitialized local variable and disable unused code Stefan Weil
2011-05-07 21:50 ` Peter Maydell [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=BANLkTim2kZtmUmj-QFdLE+TKYx0wQ-sakg@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=riku.voipio@iki.fi \
--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 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).