From f995bbe8e62fdb5607acb1ee127240cfe50d2b8f Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Wed, 5 Apr 2017 19:21:33 +0100 Subject: -Wwrite-strings: Constify struct disassemble_info's disassembler_options field The memory disassemble_info::disassembler_options points to is always owned by the client. I.e., that field is an non-owning, observing pointer. Thus const makes sense. Are the include/ and opcodes/ bits OK? Tested on x86_64 Fedora 23, built with --enable-targets=all. include/ChangeLog: 2017-04-05 Pedro Alves * dis-asm.h (disassemble_info) : Now a "const char *". (next_disassembler_option): Constify. opcodes/ChangeLog: 2017-04-05 Pedro Alves * arc-dis.c (parse_option, parse_disassembler_options): Constify. * arm-dis.c (parse_arm_disassembler_options): Constify. * ppc-dis.c (powerpc_init_dialect): Constify local. * vax-dis.c (parse_disassembler_options): Constify. gdb/ChangeLog: 2017-04-05 Pedro Alves * arm-tdep.c (show_disassembly_style_sfunc): Constify local. * disasm.c (set_disassembler_options): Constify local. * i386-tdep.c (i386_print_insn): Remove cast and FIXME comment. --- gdb/i386-tdep.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'gdb/i386-tdep.c') diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index ec8b5d3..70bd47c 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -4009,9 +4009,7 @@ i386_print_insn (bfd_vma pc, struct disassemble_info *info) gdb_assert (disassembly_flavor == att_flavor || disassembly_flavor == intel_flavor); - /* FIXME: kettenis/20020915: Until disassembler_options is properly - constified, cast to prevent a compiler warning. */ - info->disassembler_options = (char *) disassembly_flavor; + info->disassembler_options = disassembly_flavor; return print_insn_i386 (pc, info); } -- cgit v1.1