On Fri 27 Oct 2017 02:46:54 AM CEST, Akiv Jhirad <[email protected]> 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