[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 Hajnoczi
Subject: Re: [Qemu-trivial] [PATCH] Check fread() results to avoid gcc 4.6 warnings
Date: Mon, 1 Aug 2011 11:19:38 +0100

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>

reply via email to

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