Remove "struct" keyword in range-based for loops

I get this kind of errors with GCC 6.3.0:

/home/simark/src/binutils-gdb/gdb/breakpoint.c: In function 'void print_solib_event(int)':
/home/simark/src/binutils-gdb/gdb/breakpoint.c:4618:12: error: types may not be defined in a for-range-declaration [-Werror]
       for (struct so_list *iter : current_program_space->added_solibs)
            ^~~~~~

Removing the struct keyword makes it happy.

gdb/ChangeLog:

	* breakpoint.c (print_solib_event, check_status_catch_solib):
	Remove struct keyword in range-based for loops.
	* dbxread.c (find_corresponding_bincl_psymtab): Likewise.
	* dwarf2read.c (compute_delayed_physnames, rust_union_quirks);
	Likewise.
	* linespec.c (find_superclass_methods, search_minsyms_for_name):
	Likewise.
	* symfile.c (addr_info_make_relative): Likewise.
	* thread.c (value_in_thread_stack_temporaries): Likewise.
This commit is contained in:
Simon Marchi
2018-05-29 20:13:04 -04:00
parent 51af6fa066
commit 5294170687
7 changed files with 22 additions and 10 deletions

View File

@@ -4615,7 +4615,7 @@ print_solib_event (int is_catchpoint)
current_uiout->text (_(" Inferior loaded "));
ui_out_emit_list list_emitter (current_uiout, "added");
bool first = true;
for (struct so_list *iter : current_program_space->added_solibs)
for (so_list *iter : current_program_space->added_solibs)
{
if (!first)
current_uiout->text (" ");
@@ -8004,7 +8004,7 @@ check_status_catch_solib (struct bpstats *bs)
if (self->is_load)
{
for (struct so_list *iter : current_program_space->added_solibs)
for (so_list *iter : current_program_space->added_solibs)
{
if (!self->regex
|| self->compiled->exec (iter->so_name, 0, NULL, 0) == 0)