-Wwrite-strings: Constify warning_pre_print

-Wwrite-strings flags a warning here:

  char *warning_pre_print = "\nwarning: ";

gdb/ChangeLog:
2017-04-05  Pedro Alves	 <palves@redhat.com>

	* main.c (captured_main_1): Use gdb::unique_xmalloc_ptr to manage
	the memory of the temporary warning_pre_print override.
	* utils.c (warning_pre_print): Constify.
	* utils.h (warning_pre_print): Constify.
This commit is contained in:
Pedro Alves
2017-04-05 19:21:34 +01:00
parent be47f9e818
commit 69bbf46523
4 changed files with 13 additions and 4 deletions

View File

@@ -122,7 +122,7 @@ show_sevenbit_strings (struct ui_file *file, int from_tty,
/* String to be printed before warning messages, if any. */
char *warning_pre_print = "\nwarning: ";
const char *warning_pre_print = "\nwarning: ";
int pagination_enabled = 1;
static void