Remove more "struct" keywords in range-based for loops
authorSimon Marchi <simon.marchi@polymtl.ca>
Mon, 11 Jun 2018 02:33:37 +0000 (22:33 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Mon, 11 Jun 2018 02:34:08 +0000 (22:34 -0400)
GCC 6.3.0 produces this kind of errors:

  CXX    dwarf2read.o
/home/simark/src/binutils-gdb/gdb/dwarf2read.c: In function 'void process_cu_includes(dwarf2_per_objfile*)':
/home/simark/src/binutils-gdb/gdb/dwarf2read.c:10220:8: error: types may not be defined in a for-range-declaration [-Werror]
   for (struct dwarf2_per_cu_data *iter : dwarf2_per_objfile->just_read_cus)
        ^~~~~~

Removing the struct keyword makes it happy.

gdb/ChangeLog:

* dwarf2read.c (process_cu_includes): Remove struct keyword.
* serial.c (serial_interface_lookup): Remove struct keyword.

gdb/ChangeLog
gdb/dwarf2read.c
gdb/serial.c

index 0e5c0685cc294f00533cf5501cc88ba9493ac49a..feef6a411266721dacd15f94b40086256c5faf89 100644 (file)
@@ -1,3 +1,8 @@
+2018-06-10  Simon Marchi  <simon.marchi@polymtl.ca>
+
+       * dwarf2read.c (process_cu_includes): Remove struct keyword.
+       * serial.c (serial_interface_lookup): Remove struct keyword.
+
 2018-06-10  Tom Tromey  <tom@tromey.com>
 
        * procfs.c (procfs_target::xfer_partial): Use "beneath" as a
index 7f1857930b1db46226032b107fb28cb3970ab058..81e1cfb909fcbf17c2b3e7a5becf3153dc64401d 100644 (file)
@@ -10217,7 +10217,7 @@ compute_compunit_symtab_includes (struct dwarf2_per_cu_data *per_cu)
 static void
 process_cu_includes (struct dwarf2_per_objfile *dwarf2_per_objfile)
 {
-  for (struct dwarf2_per_cu_data *iter : dwarf2_per_objfile->just_read_cus)
+  for (dwarf2_per_cu_data *iter : dwarf2_per_objfile->just_read_cus)
     {
       if (! iter->is_debug_types)
        compute_compunit_symtab_includes (iter);
index 16308ab9c72d8b8a903c3ce1bd53c11d717190c7..0239fc833712518d5682e4b874c2c7fab3938121 100644 (file)
@@ -143,7 +143,7 @@ serial_log_command (struct target_ops *self, const char *cmd)
 static const struct serial_ops *
 serial_interface_lookup (const char *name)
 {
-  for (const struct serial_ops *ops : serial_ops_list)
+  for (const serial_ops *ops : serial_ops_list)
     if (strcmp (name, ops->name) == 0)
       return ops;