From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54935) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsOQ6-0000OX-5r for qemu-devel@nongnu.org; Thu, 27 Jun 2013 22:28:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UsOQ5-000754-4g for qemu-devel@nongnu.org; Thu, 27 Jun 2013 22:28:18 -0400 Received: from e28smtp04.in.ibm.com ([122.248.162.4]:42285) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsOQ4-00074L-Fu for qemu-devel@nongnu.org; Thu, 27 Jun 2013 22:28:17 -0400 Received: from /spool/local by e28smtp04.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 28 Jun 2013 07:51:53 +0530 Received: from d28relay02.in.ibm.com (d28relay02.in.ibm.com [9.184.220.59]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id DF6061258043 for ; Fri, 28 Jun 2013 07:57:13 +0530 (IST) Received: from d28av05.in.ibm.com (d28av05.in.ibm.com [9.184.220.67]) by d28relay02.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r5S2STkE24445172 for ; Fri, 28 Jun 2013 07:58:30 +0530 Received: from d28av05.in.ibm.com (loopback [127.0.0.1]) by d28av05.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r5S2S7oZ019172 for ; Fri, 28 Jun 2013 12:28:07 +1000 Message-ID: <51CCF436.1010904@linux.vnet.ibm.com> Date: Fri, 28 Jun 2013 10:25:58 +0800 From: Wenchao Xia MIME-Version: 1.0 References: <1372303666-12323-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1372303666-12323-2-git-send-email-xiawenc@linux.vnet.ibm.com> <51CCADFF.4040805@redhat.com> In-Reply-To: <51CCADFF.4040805@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH V3 1/7] monitor: discard global variable *cur_mon in completion functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: pbonzini@redhat.com, lcapitulino@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com 于 2013-6-28 5:26, Eric Blake 写道: > On 06/26/2013 09:27 PM, Wenchao Xia wrote: >> Parameter *mon is added to replace *cur_mon, and readline_completion() >> pass rs->mon as value, which should be initialized in readline_init() >> called by monitor_init(). In short, structure ReadLineState controls >> where the action would be taken now. >> >> Signed-off-by: Wenchao Xia >> --- > >> @@ -4075,20 +4075,27 @@ static void file_completion(const char *input) >> if (stat(file, &sb) == 0 && S_ISDIR(sb.st_mode)) { >> pstrcat(file, sizeof(file), "/"); >> } >> - readline_add_completion(cur_mon->rs, file); >> + readline_add_completion(mon->rs, file); >> } >> } >> closedir(ffs); > > Oops, I started reviewing that before noticing you posted a v3. At any > rate, my review of v2 still stands on this patch. Meanwhile, I just > barely noticed that this pre-existing code might cause a -Wshadow > warning in the future if is ever included. I'm not sure > what qemu's policy is on being clean against -Wshadow warnings, but I > personally tend to avoid local variables whose name might conflict with > global functions. > Thanks for reviewing. I'll fix what you mentioned in v2. For the -Wshadow warning, I guess you mean "file" right? It would be a bit hard to check this warning for new patch, since this warning now exist in many code. In my opinion, it would be better to have a separate series to clean up this warnings first, then check new patches for this issue. -- Best Regards Wenchao Xia