From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43141) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c1KTk-0001Yo-W9 for qemu-devel@nongnu.org; Mon, 31 Oct 2016 17:50:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c1KTk-000657-5T for qemu-devel@nongnu.org; Mon, 31 Oct 2016 17:50:52 -0400 From: Jeff Cody Date: Mon, 31 Oct 2016 17:50:44 -0400 Message-Id: <259818682e41b95ae60f1423b87954a3fe377639.1477950393.git.jcody@redhat.com> Subject: [Qemu-devel] [PATCH 1/1] migration: fix compiler warning on uninitialized variable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, mark.cave-ayland@ilande.co.uk, zhang.zhanghailiang@huawei.com, quintela@redhat.com Some older GCC versions (e.g. 4.4.7) report a warning on an uninitialized variable for 'request', even though all possible code paths that reference 'request' will be initialized. To appease these versions, initialize the variable to 0. Reported-by: Mark Cave-Ayland Signed-off-by: Jeff Cody --- migration/colo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/colo.c b/migration/colo.c index e7224b8..93c85c5 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -439,7 +439,7 @@ void *colo_process_incoming_thread(void *opaque) } while (mis->state == MIGRATION_STATUS_COLO) { - int request; + int request = 0; colo_wait_handle_message(mis->from_src_file, &request, &local_err); if (local_err) { -- 2.7.4