[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [Qemu-trivial] [PATCH] Check fread() results to avoid g
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [Qemu-trivial] [PATCH] Check fread() results to avoid gcc 4.6 warnings |
Date: |
Wed, 3 Aug 2011 11:15:27 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Mon, Aug 01, 2011 at 11:19:38AM +0100, 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>
I'm not taking this into the trivial-patches tree because a build fix
like this should be merged sooner. With trivial-patches I only send one
pull request per week and in the meantime people would have to
./configure --disable-werror which isn't good.
Stefan