From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22308 invoked by alias); 28 Feb 2011 18:41:28 -0000 Received: (qmail 22292 invoked by uid 22791); 28 Feb 2011 18:41:26 -0000 X-SWARE-Spam-Status: No, hits=-5.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-outbound-1.vmware.com (HELO smtp-outbound-1.vmware.com) (65.115.85.69) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 28 Feb 2011 18:41:17 +0000 Received: from mailhost2.vmware.com (mailhost2.vmware.com [10.16.67.167]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 84DFAB008; Mon, 28 Feb 2011 10:41:16 -0800 (PST) Received: from msnyder-server.eng.vmware.com (promd-2s-dhcp138.eng.vmware.com [10.20.124.138]) by mailhost2.vmware.com (Postfix) with ESMTP id 743168E5B8; Mon, 28 Feb 2011 10:41:16 -0800 (PST) Message-ID: <4D6BEC4C.9010405@vmware.com> Date: Mon, 28 Feb 2011 18:43:00 -0000 From: Michael Snyder User-Agent: Thunderbird 2.0.0.24 (X11/20101201) MIME-Version: 1.0 To: Ulrich Weigand CC: Joel Brobecker , "gdb-patches@sourceware.org" , "ken.werner@de.ibm.com" Subject: Re: [rfa] function parameter shadowed by local variable in opencl-lang.c References: <201102281516.p1SFGioB006112@d06av02.portsmouth.uk.ibm.com> In-Reply-To: <201102281516.p1SFGioB006112@d06av02.portsmouth.uk.ibm.com> Content-Type: multipart/mixed; boundary="------------020606020005070400060709" X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-02/txt/msg00931.txt.bz2 This is a multi-part message in MIME format. --------------020606020005070400060709 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 442 Ulrich Weigand wrote: > Joel Brobecker wrote: >>>> Probably this wasn't intentional? >>>> >>> Oops, another instance of the same thing: >> I wish the compiler would warn us about things like this... The patch >> looks correct to me, but I will let Ken and Ulrich take a look. Perhaps >> they'll be able to suggest a more specific name than `length2' ;-). > > I guess I'd go with something along these lines ... So committed, as attached. --------------020606020005070400060709 Content-Type: text/plain; name="rename.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="rename.txt" Content-length: 1512 2011-02-28 Michael Snyder * opencl-lang.c (lval_func_check_validity): Rename inner variables. (lval_func_check_synthetic_pointer): Ditto. Index: opencl-lang.c =================================================================== RCS file: /cvs/src/src/gdb/opencl-lang.c,v retrieving revision 1.8 diff -u -p -u -p -r1.8 opencl-lang.c --- opencl-lang.c 28 Feb 2011 18:31:36 -0000 1.8 +++ opencl-lang.c 28 Feb 2011 18:39:17 -0000 @@ -263,11 +263,11 @@ lval_func_check_validity (const struct v for (i = start; i < end; i++) { - int startoffset = (i == start) ? startrest : 0; - int length = (i == end) ? endrest : elsize; + int comp_offset = (i == start) ? startrest : 0; + int comp_length = (i == end) ? endrest : elsize; - if (!value_bits_valid (c->val, c->indices[i] * elsize + startoffset, - length)) + if (!value_bits_valid (c->val, c->indices[i] * elsize + comp_offset, + comp_length)) return 0; } @@ -317,12 +317,12 @@ lval_func_check_synthetic_pointer (const for (i = start; i < end; i++) { - int startoffset = (i == start) ? startrest : 0; - int length = (i == end) ? endrest : elsize; + int comp_offset = (i == start) ? startrest : 0; + int comp_length = (i == end) ? endrest : elsize; if (!value_bits_synthetic_pointer (c->val, - c->indices[i] * elsize + startoffset, - length)) + c->indices[i] * elsize + comp_offset, + comp_length)) return 0; } --------------020606020005070400060709--