From fdf9e36fa2ed39f0da0dfa5dfdbd8e2452c6cb45 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Wed, 5 Apr 2017 19:21:35 +0100 Subject: -Wwrite-strings: MI -info-os -Wwrite-strings flags this attempt to convert a string literal to "char *": info_osdata_command ("", 0); info_osdata_command is a command function. We could address this by simply passing NULL instead of "". However, I went a little bit further and added a new function that is called by both the CLI and MI. gdb/ChangeLog: 2017-04-05 Pedro Alves * mi/mi-cmd-info.c (mi_cmd_info_os): Call info_osdata instead of info_osdata_command. * osdata.c (info_osdata_command): Rename to ... (info_osdata): ... this. Constify 'type' parameter, and remove the 'from_tty' parameter. Accept NULL TYPE. (info_osdata_command): New function. * osdata.h (info_osdata_command): Remove declaration. (info_osdata): New declaration. --- gdb/osdata.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gdb/osdata.h') diff --git a/gdb/osdata.h b/gdb/osdata.h index bda0112..5921384 100644 --- a/gdb/osdata.h +++ b/gdb/osdata.h @@ -49,6 +49,10 @@ void osdata_free (struct osdata *); struct cleanup *make_cleanup_osdata_free (struct osdata *data); struct osdata *get_osdata (const char *type); const char *get_osdata_column (struct osdata_item *item, const char *name); -void info_osdata_command (char *type, int from_tty); + +/* Dump TYPE info to the current uiout builder. If TYPE is either + NULL or empty, then dump the top level table that lists the + available types of OS data. */ +void info_osdata (const char *type); #endif /* OSDATA_H */ -- cgit v1.1