From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3234 invoked by alias); 17 Feb 2010 21:32:18 -0000 Received: (qmail 3224 invoked by uid 22791); 17 Feb 2010 21:32:18 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-fx0-f218.google.com (HELO mail-fx0-f218.google.com) (209.85.220.218) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 17 Feb 2010 21:32:13 +0000 Received: by fxm10 with SMTP id 10so7971902fxm.29 for ; Wed, 17 Feb 2010 13:32:11 -0800 (PST) MIME-Version: 1.0 Received: by 10.204.48.144 with SMTP id r16mr5631413bkf.176.1266442330931; Wed, 17 Feb 2010 13:32:10 -0800 (PST) In-Reply-To: References: <206fcf961002170906l1bdca005h3833890d35d7db5c@mail.gmail.com> <4B7C3571.60808@gnu.org> Date: Wed, 17 Feb 2010 21:32:00 -0000 Message-ID: Subject: Re: gcc/cp/pt.c: use ngettext() when needed From: Marco Poletti To: "Joseph S. Myers" Cc: Paolo Bonzini , 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 X-IsSubscribed: yes 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/msg00700.txt.bz2 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 print= f). >> 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 call > 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*, ...) ? Does the exgettext patch need some changes to reflect this change? > -- > Joseph S. Myers > joseph@codesourcery.com >