This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH obv] Remove struct keyword from range-based for loop
- From: Simon Marchi <simon dot marchi at ericsson dot com>
- To: <gdb-patches at sourceware dot org>
- Cc: Simon Marchi <simon dot marchi at ericsson dot com>
- Date: Mon, 27 Feb 2017 14:11:26 -0500
- Subject: [PATCH obv] Remove struct keyword from range-based for loop
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=simon dot marchi at ericsson dot com;
- References: <20170227185535.11586-1-simon.marchi@ericsson.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
FYI, I have pushed this as obvious. My previous patch does not compile
with a recent GCC.
The previous patch introduced this error with recent-ish GCCs:
../../binutils-gdb/gdb/remote.c: In function ‘int remote_add_target_side_condition(gdbarch*, bp_target_info*, char*, char*)’:
../../binutils-gdb/gdb/remote.c:9668:8: error: types may not be defined in a for-range-declaration [-Werror]
for (struct agent_expr *aexpr : bp_tgt->conditions)
^~~~~~
Removing the struct keyword fixes the error.
gdb/ChangeLog:
* remote.c (remote_add_target_side_condition): Remove "struct"
keyword from range-based for loop.
---
gdb/ChangeLog | 5 +++++
gdb/remote.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index a872f1bfb9..fafa10c84e 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2017-02-27 Simon Marchi <simon.marchi@ericsson.com>
+ * remote.c (remote_add_target_side_condition): Remove "struct"
+ keyword from range-based for loop.
+
+2017-02-27 Simon Marchi <simon.marchi@ericsson.com>
+
* remote.c (remote_add_target_side_condition): Use range-based
for loop. Update comment.
diff --git a/gdb/remote.c b/gdb/remote.c
index aedbd08cc4..5da8319823 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -9665,7 +9665,7 @@ remote_add_target_side_condition (struct gdbarch *gdbarch,
buf++;
/* Send conditions to the target. */
- for (struct agent_expr *aexpr : bp_tgt->conditions)
+ for (agent_expr *aexpr : bp_tgt->conditions)
{
xsnprintf (buf, buf_end - buf, "X%x,", aexpr->len);
buf += strlen (buf);
--
2.11.0