This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix -Wformat-extra-args warning.
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Yao Qi <yao at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 26 Nov 2012 10:37:20 +0100
- Subject: Re: [PATCH] Fix -Wformat-extra-args warning.
- References: <1353921793-26314-1-git-send-email-yao@codesourcery.com>
Thanks for doing all those cleanups!
> 2012-11-26 Yao Qi <yao@codesourcery.com>
>
> * symtab.c (symtab_symbol_info): Fix a -Wformat-extra-args
> warning.
Your version does look much better to me also, by a mile. I do think
you need i18n, though. OK with the _() mark up.
> ---
> gdb/symtab.c | 9 +++++----
> 1 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/gdb/symtab.c b/gdb/symtab.c
> index 05943cf..e8cd861 100644
> --- a/gdb/symtab.c
> +++ b/gdb/symtab.c
> @@ -3778,10 +3778,11 @@ symtab_symbol_info (char *regexp, enum search_domain kind, int from_tty)
> search_symbols (regexp, kind, 0, (char **) NULL, &symbols);
> old_chain = make_cleanup_free_search_symbols (symbols);
>
> - printf_filtered (regexp
> - ? "All %ss matching regular expression \"%s\":\n"
> - : "All defined %ss:\n",
> - classnames[kind], regexp);
> + if (regexp != NULL)
> + printf_filtered ("All %ss matching regular expression \"%s\":\n",
> + classnames[kind], regexp);
> + else
> + printf_filtered ("All defined %ss:\n", classnames[kind]);
>
> for (p = symbols; p != NULL; p = p->next)
> {
--
Joel