qemu-discuss
[Top][All Lists]
Advanced

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

Re: [Qemu-discuss] QEMU make error


From: Alberto Garcia
Subject: Re: [Qemu-discuss] QEMU make error
Date: Sat, 28 Oct 2017 21:55:53 +0200
User-agent: Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu)

On Fri 27 Oct 2017 02:46:54 AM CEST, Akiv Jhirad <address@hidden> wrote:
> When running make in the qemu build, I get the error:
>
> /home/rtems/pc_rtems/qemu/replay/replay-internal.c: In function
> 'replay_put_array':
>
> /home/rtems/pc_rtems/qemu/replay/replay-internal.c:65:15: error:
>
> ignoring return value of 'fwrite', declared with attribute
> warn_unused_result [-Werror=unused-result]
>
>          fwrite(buf, 1, size, replay_file);
>
>                ^

The return value of fwrite() should be checked, I would expect something
like this:

     if (replay_file) {
         replay_put_dword(size);
-        fwrite(buf, 1, size, replay_file);
+        if (fwrite(buf, 1, size, replay_file) != size) {
+            error_report("replay write error");
+        }
     }

Pavel, what do you say?

Berto



reply via email to

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