qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Berger <stefanb@linux.vnet.ibm.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org,
	David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [Qemu-devel] [Qemu-trivial] [PATCH] Check fread() results to avoid gcc 4.6 warnings
Date: Wed, 03 Aug 2011 09:46:55 -0400	[thread overview]
Message-ID: <4E39514F.6080200@linux.vnet.ibm.com> (raw)
In-Reply-To: <CAJSP0QXvArm0_j0MgsJ2=nJWuGTGSMVTNbPBZYO5S+VuUY-uwA@mail.gmail.com>

On 08/01/2011 06:19 AM, Stefan Hajnoczi wrote:
> On Mon, Aug 1, 2011 at 7:49 AM, David Gibson
> <david@gibson.dropbear.id.au>  wrote:
>> When compiling with gcc 4.6, some code in fw_cfg.c complains that fop_ret
>> is assigned but not used (which is true).  However, it looks like the
>> meaningless assignments to fop_ret were done to suppress other gcc warnings
>> due to the fact that fread() is labelled as warn_unused_result in glibc.
>>
>> This patch avoids both errors, by actually checking the fread() result code
>> and dropping out with an error message if it fails.
>>
>> Signed-off-by: David Gibson<david@gibson.dropbear.id.au>
>> ---
>>   hw/fw_cfg.c |   13 +++++++++++++
>>   1 files changed, 13 insertions(+), 0 deletions(-)
> Reviewed-by: Stefan Hajnoczi<stefanha@linux.vnet.ibm.com>
>
Tested-by: Stefan Berger <stefanb@linux.vnet.ibm.com>

  parent reply	other threads:[~2011-08-03 13:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-01  6:49 [Qemu-devel] [PATCH] Check fread() results to avoid gcc 4.6 warnings David Gibson
2011-08-01 10:19 ` [Qemu-devel] [Qemu-trivial] " Stefan Hajnoczi
2011-08-03 10:15   ` Stefan Hajnoczi
2011-08-03 13:46   ` Stefan Berger [this message]
2011-08-05 16:46 ` [Qemu-devel] " Anthony Liguori

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=4E39514F.6080200@linux.vnet.ibm.com \
    --to=stefanb@linux.vnet.ibm.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=stefanha@gmail.com \
    /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).