[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-trivial] [PATCH] Check fread() results to avoid gcc 4.6 warnin

From: Stefan Berger
Subject: Re: [Qemu-trivial] [PATCH] Check fread() results to avoid gcc 4.6 warnings
Date: Wed, 03 Aug 2011 09:46:55 -0400
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20110621 Fedora/3.1.11-1.fc14 Lightning/1.0b3pre Thunderbird/3.1.11

On 08/01/2011 06:19 AM, Stefan Hajnoczi wrote:
On Mon, Aug 1, 2011 at 7:49 AM, David Gibson
<address@hidden>  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<address@hidden>
  hw/fw_cfg.c |   13 +++++++++++++
  1 files changed, 13 insertions(+), 0 deletions(-)
Reviewed-by: Stefan Hajnoczi<address@hidden>

Tested-by: Stefan Berger <address@hidden>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]