This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcc/cp/pt.c: use ngettext() when needed


2010/2/17 Joseph S. Myers <joseph@codesourcery.com>:
> On Wed, 17 Feb 2010, Paolo Bonzini wrote:
>
>> Marco, why don't you instead add warning_n/inform_n/error_n, like
>>
>> ? ?error_n (TREE_VEC_LENGTH (parms),
>> ? ? ? ? ? ? "redeclared with %d template parameter",
>> ? ? ? ? ? ? "redeclared with %d template parameters",
>> ? ? ? ? ? ? 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 printf).
>> 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. ?(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
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]