From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14161 invoked by alias); 17 Feb 2010 23:23:04 -0000 Received: (qmail 14150 invoked by uid 22791); 17 Feb 2010 23:23:01 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-fx0-f222.google.com (HELO mail-fx0-f222.google.com) (209.85.220.222) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 17 Feb 2010 23:22:57 +0000 Received: by fxm22 with SMTP id 22so8102691fxm.16 for ; Wed, 17 Feb 2010 15:22:55 -0800 (PST) MIME-Version: 1.0 Received: by 10.204.15.4 with SMTP id i4mr2744452bka.21.1266448975150; Wed, 17 Feb 2010 15:22:55 -0800 (PST) In-Reply-To: References: <206fcf961002170906l1bdca005h3833890d35d7db5c@mail.gmail.com> <4B7C3571.60808@gnu.org> From: Paolo Bonzini Date: Wed, 17 Feb 2010 23:23:00 -0000 Message-ID: Subject: Re: gcc/cp/pt.c: use ngettext() when needed To: Marco Poletti Cc: "Joseph S. Myers" , gdr@integrable-solutions.net, Gabriel Dos Reis , gcc-patches@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2010-02/txt/msg00707.txt.bz2 On Wed, Feb 17, 2010 at 22:32, Marco Poletti wrot= e: > 2010/2/17 Joseph S. Myers : >> On Wed, 17 Feb 2010, Paolo Bonzini wrote: >> >>> Marco, why don't you instead add warning_n/inform_n/error_n, like >>> >>> =A0 =A0error_n (TREE_VEC_LENGTH (parms), >>> =A0 =A0 =A0 =A0 =A0 =A0 "redeclared with %d template parameter", >>> =A0 =A0 =A0 =A0 =A0 =A0 "redeclared with %d template parameters", >>> =A0 =A0 =A0 =A0 =A0 =A0 TREE_VEC_LENGTH (parms)); >>> >>> (compared to ngettext I'm moving the number argument before the strings= , to >>> make sure it's not confused with the first positional parameter of prin= tf). >>> This can be taught to exgettext with something like this: >> >> If you add new functions like that, they should have a leading location_t >> argument for an explicit location, rather than emulating the legacy >> functions without an explicit location. =A0(It's OK when converting a ca= ll >> to use such a new function just to put input_location for the location >> rather than trying to work out a more precise location for the error.) >> > > So it would be something like > > error_n(location_t,int,const char*,const char*, ...) > > ? Yes, with ... Thanks Joseph for pointing out location_t. Also for warning_n you'd need an extra argument for the option name, but that one function can come later. > Does the exgettext patch need some changes to reflect this change? No. Paolo