Work around GCC 6.3.1 bug
authorPedro Alves <palves@redhat.com>
Mon, 16 Oct 2017 12:39:12 +0000 (13:39 +0100)
committerPedro Alves <palves@redhat.com>
Mon, 16 Oct 2017 12:39:12 +0000 (13:39 +0100)
commit63f0e930d4667eb7dbc95c78f770cd58acd328ef
treef95139f502a8df7a9dbc6fc2c2c9f93a34574ff3
parent5c3261b0e834647cf9eb555320e20871b7854f98
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.
gdb/ChangeLog
gdb/elfread.c
gdb/probe.c