GDB build failure when using latest (ToT) GCC

Simon Marchi
Mon Feb 27 19:57:00 GMT 2017

On 2017-02-27 14:50, Steve Ellcey wrote:
> I am building the ToT gdb with a ToT GCC and getting this error:
> ../../../src/binutils-gdb/gdb/remote.c: In function ‘int 
> remote_add_target_side_
> condition(gdbarch*, bp_target_info*, char*, char*)’:
> ../../../src/binutils-gdb/gdb/remote.c:9668:8: error: types may not be 
> defined i
> n a for-range-declaration [-fpermissive]
>    for (struct agent_expr *aexpr : bp_tgt->conditions)
>         ^~~~~~
> Makefile:1898: recipe for target 'remote.o' failed
> Does anyone know how to change this code so that GCC will not complain?
> I am not familiar with C++ for ranges.  I get a bunch of warnings too, 
> but this
> is a hard error that stops my compilation.  Yes, I can use -fpermissive 
> but I
> would rather not and this will need to be fixed when GCC 7.X comes out.

Hi Steve,

I indeed broke the build for recent GCCs in

Use range-based for loop in remote_add_target_side_condition

and fixed it right after with

Remove struct keyword from range-based for loop

I am still using an ancient 4.8 GCC, so I did not see it, but Sergio's 
buildbot informed me within a few minutes.  Let's just pretend it was a 
test for the bot :).  Sorry about the inconvenience and thanks for being 


More information about the Gdb mailing list