summaryrefslogtreecommitdiff
path: root/gdb/elfread.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2017-10-16 13:39:12 +0100
committerPedro Alves <palves@redhat.com>2017-10-16 13:39:12 +0100
commit63f0e930d4667eb7dbc95c78f770cd58acd328ef (patch)
treef95139f502a8df7a9dbc6fc2c2c9f93a34574ff3 /gdb/elfread.c
parent5c3261b0e834647cf9eb555320e20871b7854f98 (diff)
downloadbinutils-gdb-63f0e930d4667eb7dbc95c78f770cd58acd328ef.tar.gz
Work around GCC 6.3.1 bug
This commit works around a GCC 6.3.1 bug several people are hitting: https://sourceware.org/ml/gdb-patches/2017-09/msg00270.html https://sourceware.org/ml/gdb-patches/2017-10/msg00418.html It manifests like this: ../../../binutils-gdb/gdb/probe.c:68:12: error: types may not be defined in a for-range-declaration [-Werror] for (struct probe *probe : probes) ^~~~~~ Fix it by renaming the range-for named variables to something different from their type's name. gdb/ChangeLog: 2017-10-16 Pedro Alves <palves@redhat.com> * elfread.c (probe_key_free): Rename range-for variable. * probe.c (parse_probes_in_pspace, find_probes_in_objfile) (find_probe_by_pc, collect_probes): Rename range-for variable.
Diffstat (limited to 'gdb/elfread.c')
-rw-r--r--gdb/elfread.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/elfread.c b/gdb/elfread.c
index 436d9b5b4ac..4e110716c3b 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -1340,8 +1340,8 @@ probe_key_free (bfd *abfd, void *d)
{
std::vector<probe *> *probes = (std::vector<probe *> *) d;
- for (struct probe *probe : *probes)
- probe->pops->destroy (probe);
+ for (probe *p : *probes)
+ p->pops->destroy (p);
delete probes;
}