Discussion:
[Bug gdb/23469] New: Compilation warning about struct other_sections in symfile.c using GCC 6.3.0
eliz at gnu dot org
2018-07-31 11:21:14 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23469

Bug ID: 23469
Summary: Compilation warning about struct other_sections in
symfile.c using GCC 6.3.0
Product: gdb
Version: HEAD
Status: NEW
Severity: normal
Priority: P2
Component: gdb
Assignee: unassigned at sourceware dot org
Reporter: eliz at gnu dot org
Target Milestone: ---

Compiling GDB 8.1.90 with GCC 6.3.0 on MinGW causes this warning:

CXX symfile.o
symfile.c: In function 'void set_objfile_default_section_offset(objfile*,
const section_addr_info&, CORE_ADDR)':
symfile.c:2114:14: warning: types may not be defined in a
for-range-declaration
for (const struct other_sections *objf_sect : objf_addrs_sorted)
^~~~~~

It turns out this has been fixed on master already, so the proposed solution is
to cherry-pick that commit (ff27d0737ef0) to the GDB 8.2 branch. See

https://www.sourceware.org/ml/gdb-patches/2018-07/msg00755.html
--
You are receiving this mail because:
You are on the CC list for the bug.
cvs-commit at gcc dot gnu.org
2018-07-31 16:55:08 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23469

--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The gdb-8.2-branch branch has been updated by Eli Zaretskii
<***@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=599849befcc9a03584c7c03e65e5d5cf7ea0e4e8

commit 599849befcc9a03584c7c03e65e5d5cf7ea0e4e8
Author: Simon Marchi <***@polymtl.ca>
Date: Fri Jul 13 22:06:34 2018 -0400

Remove struct keyword in range-based for loop

PR gdb/23469
Fix this with gcc 6.3.0:

/home/simark/src/binutils-gdb/gdb/symfile.c: In function 'void
set_objfile_default_section_offset(objfile*, const section_addr_info&,
CORE_ADDR)':
/home/simark/src/binutils-gdb/gdb/symfile.c:2114:14: error: types may not
be defined in a for-range-declaration [-Werror]
for (const struct other_sections *objf_sect : objf_addrs_sorted)
^~~~~~
gdb/ChangeLog:

* symfile.c (set_objfile_default_section_offset): Remove struct
keyword.

(cherry picked from commit ff27d0737ef0c9433a6a7c83c1e678ac57a27699)
--
You are receiving this mail because:
You are on the CC list for the bug.
eliz at gnu dot org
2018-07-31 11:26:34 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23469

Eli Zaretskii <eliz at gnu dot org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED

--- Comment #2 from Eli Zaretskii <eliz at gnu dot org> ---
Fixed by cherry-picking the fix from master.
--
You are receiving this mail because:
You are on the CC list for the bug.
Loading...