From b80c3053162ec5533e120ee4e4ed30296d4c5fb2 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Tue, 27 Oct 2015 17:25:09 +0000 Subject: Make host_address_to_string/gdb_print_host_address cast parameter to 'void *' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes a set of errors like: ../../src/gdb/symfile-debug.c: In function ‘int debug_qf_map_symtabs_matching_filename(objfile*, const char*, const char*, int (*)(symtab*, void*), void*)’: ../../src/gdb/symfile-debug.c:137:39: error: invalid conversion from ‘int (*)(symtab*, void*)’ to ‘const void*’ [-fpermissive] host_address_to_string (callback), ^ Note this has to work with data and function pointers. In C++11 we may perhaps do something a bit safer, but we're not there yet, and I don't think it really matters. For now just always do a simple C-style cast in host_address_to_string itself. No point in adding a void * cast to each and every caller. gdb/ChangeLog: 2015-10-27 Pedro Alves * common/print-utils.c (host_address_to_string): Rename to ... (host_address_to_string_1): ... this. * common/print-utils.h (host_address_to_string): Reimplement as wrapper around host_address_to_string_1. * utils.c (gdb_print_host_address): Rename to ... (gdb_print_host_address_1): ... this. * utils.h (gdb_print_host_address): Reimplement as wrapper macro around host_address_to_string_1. --- gdb/common/print-utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gdb/common/print-utils.c') diff --git a/gdb/common/print-utils.c b/gdb/common/print-utils.c index 1c1a5c1..7eba07d 100644 --- a/gdb/common/print-utils.c +++ b/gdb/common/print-utils.c @@ -316,7 +316,7 @@ core_addr_to_string_nz (const CORE_ADDR addr) /* See print-utils.h. */ const char * -host_address_to_string (const void *addr) +host_address_to_string_1 (const void *addr) { char *str = get_cell (); -- cgit v1.1