[PATCH c++ 4/6] gdb_bfd_lookup_symbol: Cast const char* arguments to void*

Yao Qi qiyaoltc@gmail.com
Mon Oct 12 10:16:00 GMT 2015


Simon Marchi <simon.marchi@polymtl.ca> writes:

> /home/pedro/gdb/mygit/src/gdb/solib-frv.c: In function ‘int enable_break2()’:
> /home/pedro/gdb/mygit/src/gdb/solib-frv.c:622:72: error: invalid conversion from ‘const void*’ to ‘void*’ [-fpermissive]
>        addr = gdb_bfd_lookup_symbol (tmp_bfd, cmp_name, "_dl_debug_addr");
>                                                                         ^
> In file included from /home/pedro/gdb/mygit/src/gdb/solib-frv.c:23:0:
> /home/pedro/gdb/mygit/src/gdb/solib.h:82:18: error:   initializing argument 3 of ‘CORE_ADDR gdb_bfd_lookup_symbol(bfd*, int (*)(asymbol*, void*), void*)’ [-fpermissive]
>  extern CORE_ADDR gdb_bfd_lookup_symbol (bfd *abfd,
>                   ^
>
> The call in question is:
>
>       addr = gdb_bfd_lookup_symbol (tmp_bfd, cmp_name, "_dl_debug_addr");

Hi Simon,
Did you consider the possibility that changing argument 'data' type to
'const void *'? like this,

CORE_ADDR
gdb_bfd_lookup_symbol (bfd *abfd,
		       int (*match_sym) (asymbol *, void *),
		       const void *data)

-- 
Yao (齐尧)



More information about the Gdb-patches mailing list