From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54932) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMcwP-0001FX-0a for qemu-devel@nongnu.org; Wed, 27 Aug 2014 09:07:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMcwJ-0006Cv-2v for qemu-devel@nongnu.org; Wed, 27 Aug 2014 09:07:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35749) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMcwI-0006Cq-Rk for qemu-devel@nongnu.org; Wed, 27 Aug 2014 09:07:03 -0400 Date: Wed, 27 Aug 2014 09:06:41 -0400 From: Luiz Capitulino Message-ID: <20140827090641.15dda74e@redhat.com> In-Reply-To: <1408626189-6220-1-git-send-email-arei.gonglei@huawei.com> References: <1408626189-6220-1-git-send-email-arei.gonglei@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2] monitor: fix debug print compiling error List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: arei.gonglei@huawei.com Cc: peter.crosthwaite@xilinx.com, weidong.huang@huawei.com, qemu-devel@nongnu.org On Thu, 21 Aug 2014 21:03:09 +0800 wrote: > From: Gonglei > > error: 'i' undeclared (first use in this function) > > Signed-off-by: Gonglei Applied to the qmp branch, thanks. > --- > v2: > avoid to mix code and declarations, add a pair of {}, thanks Peter. > --- > monitor.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/monitor.c b/monitor.c > index 34cee74..667efb7 100644 > --- a/monitor.c > +++ b/monitor.c > @@ -4747,8 +4747,11 @@ static void monitor_find_completion(void *opaque, > return; > } > #ifdef DEBUG_COMPLETION > - for (i = 0; i < nb_args; i++) { > - monitor_printf(mon, "arg%d = '%s'\n", i, args[i]); > + { > + int i; > + for (i = 0; i < nb_args; i++) { > + monitor_printf(mon, "arg%d = '%s'\n", i, args[i]); > + } > } > #endif >