From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38105) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VO8fs-00029h-Gc for qemu-devel@nongnu.org; Mon, 23 Sep 2013 12:07:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VO8fn-0001nk-36 for qemu-devel@nongnu.org; Mon, 23 Sep 2013 12:07:48 -0400 Received: from static.88-198-71-155.clients.your-server.de ([88.198.71.155]:39116 helo=socrates.bennee.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VO8fm-0001nM-T6 for qemu-devel@nongnu.org; Mon, 23 Sep 2013 12:07:43 -0400 From: alex.bennee@linaro.org Date: Mon, 23 Sep 2013 17:07:30 +0100 Message-Id: <1379952450-29640-4-git-send-email-alex.bennee@linaro.org> In-Reply-To: <1379952450-29640-1-git-send-email-alex.bennee@linaro.org> References: <1379952450-29640-1-git-send-email-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH 3/3] block/stream.c: ensure copy always set List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, stefanha@redhat.com From: Alex Bennée This only showed up when compiling with --enable-trace-backend=stderr|ftrace at which point the compiler complains with the following: block/stream.c: In function ‘stream_run’: block/stream.c:141:22: error: ‘copy’ may be used uninitialized in this function [-Werror=uninitialized] Not sure exactly why it needs these options but it does seem clear the negative return case should be handled. --- block/stream.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/stream.c b/block/stream.c index 078ce4a..3b9c198 100644 --- a/block/stream.c +++ b/block/stream.c @@ -136,6 +136,8 @@ wait: } copy = (ret == 1); + } else { + copy = false; } trace_stream_one_iteration(s, sector_num, n, ret); if (ret >= 0 && copy) { -- 1.8.4