From: Simon Marchi Date: Sat, 7 Jul 2018 15:13:14 +0000 (-0400) Subject: ia64-tdep.c: Fix -Wwrite-strings errors X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e83f4d97504515f8c5f290eeb25eac87cca6892f;p=binutils-gdb.git ia64-tdep.c: Fix -Wwrite-strings errors Simply add const where necessary to get rid of errors like: /home/simark/src/binutils-gdb/gdb/ia64-libunwind-tdep.c:114:1: error: ISO C++ forbids converting a string constant to ‘char*’ [-Werror=write-strings] static char *get_reg_name = STRINGIFY(UNW_OBJ(get_reg)); ^~~~~~~~~~~~~~ /home/simark/src/binutils-gdb/gdb/common/preprocessor.h:28:25: note: in definition of macro ‘STRINGIFY_1’ #define STRINGIFY_1(x) #x ^ /home/simark/src/binutils-gdb/gdb/ia64-libunwind-tdep.c:114:29: note: in expansion of macro ‘STRINGIFY’ static char *get_reg_name = STRINGIFY(UNW_OBJ(get_reg)); ^~~~~~~~~ gdb/ChangeLog: * ia64-tdep.c (get_reg_name, get_fpreg_name, get_saveloc_name, is_signal_frame_name, step_name, init_remote_name, create_addr_space_name, destroy_addr_space_name, search_unwind_table_name, find_dyn_list_name): Constify. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 17146e810a3..076f571e2a8 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2018-07-07 Simon Marchi + + * ia64-tdep.c (get_reg_name, get_fpreg_name, get_saveloc_name, + is_signal_frame_name, step_name, init_remote_name, + create_addr_space_name, destroy_addr_space_name, + search_unwind_table_name, find_dyn_list_name): Constify. + 2018-07-05 Simon Marchi * darwin-nat.c (darwin_pthread_kill): New function. diff --git a/gdb/ia64-libunwind-tdep.c b/gdb/ia64-libunwind-tdep.c index 99782b2d701..b7eef4ac644 100644 --- a/gdb/ia64-libunwind-tdep.c +++ b/gdb/ia64-libunwind-tdep.c @@ -111,17 +111,19 @@ struct libunwind_frame_cache #define LIBUNWIND_SO_7 "libunwind-" STRINGIFY(UNW_TARGET) ".so.7" #endif -static char *get_reg_name = STRINGIFY(UNW_OBJ(get_reg)); -static char *get_fpreg_name = STRINGIFY(UNW_OBJ(get_fpreg)); -static char *get_saveloc_name = STRINGIFY(UNW_OBJ(get_save_loc)); -static char *is_signal_frame_name = STRINGIFY(UNW_OBJ(is_signal_frame)); -static char *step_name = STRINGIFY(UNW_OBJ(step)); -static char *init_remote_name = STRINGIFY(UNW_OBJ(init_remote)); -static char *create_addr_space_name = STRINGIFY(UNW_OBJ(create_addr_space)); -static char *destroy_addr_space_name = STRINGIFY(UNW_OBJ(destroy_addr_space)); -static char *search_unwind_table_name +static const char *get_reg_name = STRINGIFY(UNW_OBJ(get_reg)); +static const char *get_fpreg_name = STRINGIFY(UNW_OBJ(get_fpreg)); +static const char *get_saveloc_name = STRINGIFY(UNW_OBJ(get_save_loc)); +static const char *is_signal_frame_name = STRINGIFY(UNW_OBJ(is_signal_frame)); +static const char *step_name = STRINGIFY(UNW_OBJ(step)); +static const char *init_remote_name = STRINGIFY(UNW_OBJ(init_remote)); +static const char *create_addr_space_name + = STRINGIFY(UNW_OBJ(create_addr_space)); +static const char *destroy_addr_space_name + = STRINGIFY(UNW_OBJ(destroy_addr_space)); +static const char *search_unwind_table_name = STRINGIFY(UNW_OBJ(search_unwind_table)); -static char *find_dyn_list_name = STRINGIFY(UNW_OBJ(find_dyn_list)); +static const char *find_dyn_list_name = STRINGIFY(UNW_OBJ(find_dyn_list)); static struct libunwind_descr * libunwind_descr (struct gdbarch *gdbarch)