From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37813) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmZuh-0004gw-3e for qemu-devel@nongnu.org; Wed, 21 Sep 2016 01:17:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bmZuc-0003Ll-5L for qemu-devel@nongnu.org; Wed, 21 Sep 2016 01:17:43 -0400 Received: from mail.ispras.ru ([83.149.199.45]:34378) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmZub-00039c-Ts for qemu-devel@nongnu.org; Wed, 21 Sep 2016 01:17:38 -0400 From: "Pavel Dovgalyuk" References: <1474391326-871-1-git-send-email-felipe@nutanix.com> In-Reply-To: <1474391326-871-1-git-send-email-felipe@nutanix.com> Date: Wed, 21 Sep 2016 08:17:24 +0300 Message-ID: <000301d213c7$7142f980$53c8ec80$@ru> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Language: ru Subject: Re: [Qemu-devel] [PATCH] replay: Fix build with -Werror=unused-result List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: 'Felipe Franciosi' , 'Pavel Dovgalyuk' , 'Eric Blake' Cc: qemu-devel@nongnu.org > From: Felipe Franciosi [mailto:felipe@nutanix.com] > If compiling with -Werror=unused-result, replay-internal.c won't build > due to a call to fwrite() where the returned value is ignored. A simple > cast to (void) is not sufficient on recent GCCs, so this fixes it. > > Signed-off-by: Felipe Franciosi > --- > replay/replay-internal.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/replay/replay-internal.c b/replay/replay-internal.c > index 5835e8d..6978d76 100644 > --- a/replay/replay-internal.c > +++ b/replay/replay-internal.c > @@ -65,7 +65,7 @@ void replay_put_array(const uint8_t *buf, size_t size) > { > if (replay_file) { > replay_put_dword(size); > - fwrite(buf, 1, size, replay_file); > + (void)(fwrite(buf, 1, size, replay_file)+1); > } > } This looks very weird. I think it would be better to check the return value and stop the simulation in case of error. Pavel Dovgalyuk