[pushed] target.c: Remove struct keyword in range-based for

Message ID 20181227011617.32432-1-simon.marchi@polymtl.ca
State New
Headers show
Series
  • [pushed] target.c: Remove struct keyword in range-based for
Related show

Commit Message

Simon Marchi Dec. 27, 2018, 1:16 a.m.
I get this when compiling with a gcc 6.3.0-based cross-compiler:

  CXX    target.o
/home/simark/src/binutils-gdb/gdb/target.c: In static member function 'static void target_terminal::restore_inferior()':
/home/simark/src/binutils-gdb/gdb/target.c:396:10: error: types may not be defined in a for-range-declaration [-Werror]
     for (struct inferior *inf : all_inferiors ())
          ^~~~~~

Accomodate it by dropping the unnecessary struct keyword.  Actually, I used
"::inferior", otherwise it resolves to the inferior method of the
target_terminal class.

gdb/ChangeLog:

	* target.c (target_terminal::restore_inferior): Remove struct keyword.
---
 gdb/ChangeLog | 4 ++++
 gdb/target.c  | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

-- 
2.20.1

Patch

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 425429e07f86..397ee0458af2 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@ 
+2018-12-26  Simon Marchi  <simon.marchi@polymtl.ca>
+
+	* target.c (target_terminal::restore_inferior): Remove struct keyword.
+
 2018-12-26  Simon Marchi  <simon.marchi@ericsson.com>
 
 	* build-id.c (build_id_to_debug_bfd): Enhance debug output.
diff --git a/gdb/target.c b/gdb/target.c
index 6c63255d03c4..0a6747be10e6 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -393,7 +393,7 @@  target_terminal::restore_inferior (void)
   {
     scoped_restore_current_inferior restore_inferior;
 
-    for (struct inferior *inf : all_inferiors ())
+    for (::inferior *inf : all_inferiors ())
       {
 	if (inf->terminal_state == target_terminal_state::is_ours_for_output)
 	  {