Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@vmware.com>
To: Ulrich Weigand <uweigand@de.ibm.com>
Cc: Joel Brobecker <brobecker@adacore.com>,
	 "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
	"ken.werner@de.ibm.com" <ken.werner@de.ibm.com>
Subject: Re: [rfa] function parameter shadowed by local variable in opencl-lang.c
Date: Mon, 28 Feb 2011 18:43:00 -0000	[thread overview]
Message-ID: <4D6BEC4C.9010405@vmware.com> (raw)
In-Reply-To: <201102281516.p1SFGioB006112@d06av02.portsmouth.uk.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 442 bytes --]

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.


[-- Attachment #2: rename.txt --]
[-- Type: text/plain, Size: 1512 bytes --]

2011-02-28  Michael Snyder  <msnyder@vmware.com>

	* 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;
     }
 

      reply	other threads:[~2011-02-28 18:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-26 23:26 Michael Snyder
2011-02-26 23:36 ` Michael Snyder
2011-02-28  4:57   ` Joel Brobecker
2011-02-28  5:01     ` [RFC] Compile GDB with -Wshadow? (was: "Re: [rfa] function parameter shadowed by local variable in opencl-lang.c") Joel Brobecker
2011-02-28  5:39       ` Jan Kratochvil
2011-02-28  9:09         ` Joel Brobecker
2011-02-28  9:29           ` Mark Kettenis
2011-02-28 18:15             ` [RFC] Compile GDB with -Wshadow? Michael Snyder
2011-02-28 15:48       ` Tom Tromey
2011-02-28 15:23     ` [rfa] function parameter shadowed by local variable in opencl-lang.c Ulrich Weigand
2011-02-28 18:43       ` Michael Snyder [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D6BEC4C.9010405@vmware.com \
    --to=msnyder@vmware.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=ken.werner@de.ibm.com \
    --cc=uweigand@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox