Remove struct keyword from range-based for loop

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.
This commit is contained in:
Simon Marchi 2017-02-27 14:09:34 -05:00
parent 8362122330
commit d538e36dec
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
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

View File

@ -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);