diff options
author | Mark Wielaard <mjw@redhat.com> | 2016-09-10 10:37:35 +0000 |
---|---|---|
committer | Mark Wielaard <mark@gcc.gnu.org> | 2016-09-10 10:37:35 +0000 |
commit | 99e77371ca0fd38460f76a6c5880be67d2503292 (patch) | |
tree | 0309089e144cd3b5bf76f5b14e134f0eb129ec0e | |
parent | 7861fc4f1c40e8fabd31cd8627b0a173257eeb3c (diff) | |
download | gcc-99e77371ca0fd38460f76a6c5880be67d2503292.zip gcc-99e77371ca0fd38460f76a6c5880be67d2503292.tar.gz gcc-99e77371ca0fd38460f76a6c5880be67d2503292.tar.bz2 |
Fix -Wshadow warning in libiberty/cp-demangle.c
valgrind contains a copy of the libiberty demangler which gets compiled
with -Wshadow. That shows the following warning:
cp-demangle.c: In function ‘d_substitution’:
cp-demangle.c:3772:35: warning: declaration of ‘c’ shadows a previous local
struct demangle_component *c;
^
cp-demangle.c:3708:8: note: shadowed declaration is here
char c;
^
Fix that by renaming the struct demangle_component variable to dc.
libiberty/ChangeLog:
* cp-demangle.c (d_substitution): Change struct demangle_component
variable name from c to dc.
From-SVN: r240068
-rw-r--r-- | libiberty/ChangeLog | 5 | ||||
-rw-r--r-- | libiberty/cp-demangle.c | 10 |
2 files changed, 10 insertions, 5 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 0b97a90..6860959 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,8 @@ +2016-09-10 Mark Wielaard <mjw@redhat.com> + + * cp-demangle.c (d_substitution): Change struct demangle_component + variable name from c to dc. + 2016-08-12 Marek Polacek <polacek@redhat.com> PR c/7652 diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c index 1c2bce2..a843dc3 100644 --- a/libiberty/cp-demangle.c +++ b/libiberty/cp-demangle.c @@ -3769,7 +3769,7 @@ d_substitution (struct d_info *di, int prefix) { const char *s; int len; - struct demangle_component *c; + struct demangle_component *dc; if (p->set_last_name != NULL) di->last_name = d_make_sub (di, p->set_last_name, @@ -3785,15 +3785,15 @@ d_substitution (struct d_info *di, int prefix) len = p->simple_len; } di->expansion += len; - c = d_make_sub (di, s, len); + dc = d_make_sub (di, s, len); if (d_peek_char (di) == 'B') { /* If there are ABI tags on the abbreviation, it becomes a substitution candidate. */ - c = d_abi_tags (di, c); - d_add_substitution (di, c); + dc = d_abi_tags (di, dc); + d_add_substitution (di, dc); } - return c; + return dc; } } |