From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29498 invoked by alias); 26 Nov 2012 09:37:31 -0000 Received: (qmail 29432 invoked by uid 22791); 26 Nov 2012 09:37:31 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_NO X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 26 Nov 2012 09:37:25 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 5E1E91C7CE9; Mon, 26 Nov 2012 04:37:24 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Yg-l61Zxkgzj; Mon, 26 Nov 2012 04:37:24 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 1A1211C7F37; Mon, 26 Nov 2012 04:37:24 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id E1C5BC2708; Mon, 26 Nov 2012 10:37:20 +0100 (CET) Date: Mon, 26 Nov 2012 09:37:00 -0000 From: Joel Brobecker To: Yao Qi Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Fix -Wformat-extra-args warning. Message-ID: <20121126093720.GA12042@adacore.com> References: <1353921793-26314-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1353921793-26314-1-git-send-email-yao@codesourcery.com> User-Agent: Mutt/1.5.21 (2010-09-15) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-11/txt/msg00643.txt.bz2 Thanks for doing all those cleanups! > 2012-11-26 Yao Qi > > * 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