From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60996) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UktWz-0004RE-Ju for qemu-devel@nongnu.org; Fri, 07 Jun 2013 06:04:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UktWy-00017d-6s for qemu-devel@nongnu.org; Fri, 07 Jun 2013 06:04:25 -0400 Received: from e23smtp04.au.ibm.com ([202.81.31.146]:45482) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UktWx-00016q-J0 for qemu-devel@nongnu.org; Fri, 07 Jun 2013 06:04:24 -0400 Received: from /spool/local by e23smtp04.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 7 Jun 2013 19:50:33 +1000 Received: from d23relay04.au.ibm.com (d23relay04.au.ibm.com [9.190.234.120]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id B5EDC2CE804D for ; Fri, 7 Jun 2013 20:04:13 +1000 (EST) Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay04.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r579njI826476776 for ; Fri, 7 Jun 2013 19:49:46 +1000 Received: from d23av04.au.ibm.com (loopback [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r57A4CLt007846 for ; Fri, 7 Jun 2013 20:04:12 +1000 From: Wenchao Xia Date: Fri, 7 Jun 2013 18:02:09 +0800 Message-Id: <1370599329-16682-1-git-send-email-xiawenc@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH V2] build: remove compile warning List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, aliguori@us.ibm.com, mlureau@redhat.com, alevy@redhat.com, stefanha@redhat.com, pbonzini@redhat.com, Wenchao Xia This patch simply remove "variable may be used uninitialized" warning. Signed-off-by: Wenchao Xia --- V2: Address Stefan and Peter's comments, use 0 in send_msg() instead of initialize mhHeader. libcacard/vscclient.c | 3 +-- util/iov.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/libcacard/vscclient.c b/libcacard/vscclient.c index ac23647..7fbf1da 100644 --- a/libcacard/vscclient.c +++ b/libcacard/vscclient.c @@ -641,7 +641,6 @@ main( GIOChannel *channel_stdin; char *qemu_host; char *qemu_port; - VSCMsgHeader mhHeader; VCardEmulOptions *command_line_options = NULL; @@ -750,7 +749,7 @@ main( .magic = VSCARD_MAGIC, .capabilities = {0} }; - send_msg(VSC_Init, mhHeader.reader_id, &init, sizeof(init)); + send_msg(VSC_Init, 0, &init, sizeof(init)); g_main_loop_run(loop); g_main_loop_unref(loop); diff --git a/util/iov.c b/util/iov.c index cc6e837..b91cfb9 100644 --- a/util/iov.c +++ b/util/iov.c @@ -146,7 +146,7 @@ ssize_t iov_send_recv(int sockfd, struct iovec *iov, unsigned iov_cnt, { ssize_t total = 0; ssize_t ret; - size_t orig_len, tail; + size_t orig_len = 0, tail; unsigned niov; while (bytes > 0) { -- 1.7.1