From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20850 invoked by alias); 28 Feb 2011 15:16:55 -0000 Received: (qmail 20841 invoked by uid 22791); 28 Feb 2011 15:16:54 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,SPF_SOFTFAIL,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mtagate4.uk.ibm.com (HELO mtagate4.uk.ibm.com) (194.196.100.164) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 28 Feb 2011 15:16:48 +0000 Received: from d06nrmr1707.portsmouth.uk.ibm.com (d06nrmr1707.portsmouth.uk.ibm.com [9.149.39.225]) by mtagate4.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p1SFGkLx011378 for ; Mon, 28 Feb 2011 15:16:46 GMT Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1707.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p1SFGvon1593496 for ; Mon, 28 Feb 2011 15:16:57 GMT Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p1SFGjrQ006146 for ; Mon, 28 Feb 2011 08:16:46 -0700 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with SMTP id p1SFGioB006112; Mon, 28 Feb 2011 08:16:44 -0700 Message-Id: <201102281516.p1SFGioB006112@d06av02.portsmouth.uk.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Mon, 28 Feb 2011 16:16:44 +0100 Subject: Re: [rfa] function parameter shadowed by local variable in opencl-lang.c To: brobecker@adacore.com (Joel Brobecker) Date: Mon, 28 Feb 2011 15:23:00 -0000 From: "Ulrich Weigand" Cc: msnyder@vmware.com (Michael Snyder), gdb-patches@sourceware.org (gdb-patches@sourceware.org), ken.werner@de.ibm.com (ken.werner@de.ibm.com) In-Reply-To: <20110228045225.GC30306@adacore.com> from "Joel Brobecker" at Feb 28, 2011 08:52:25 AM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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/msg00896.txt.bz2 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 ... Bye, Ulrich Index: gdb/opencl-lang.c =================================================================== RCS file: /cvs/src/src/gdb/opencl-lang.c,v retrieving revision 1.7 diff -u -p -r1.7 opencl-lang.c --- gdb/opencl-lang.c 21 Feb 2011 15:53:10 -0000 1.7 +++ gdb/opencl-lang.c 28 Feb 2011 15:14:56 -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; } -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com