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: [Patch] Java: Prepare for %q, %< and %> in diagnostic messages


Ranjit Mathew <rmathew@gmail.com> writes:

>> >> That, and tracing the data flow and making sure that the string is
>> >> passed through _() exactly once.
>> >
>> > Thanks. I think that part is taken care of
>> > already - parse_error_context() and parse_warning_context()
>> > call issue_error_warning_from_context(), which calls
>> > warning() or error() in the core GCC framework, which
>> > then ensures that the translation is done only once.
>> 
>> It does do that, but I think it does it too late.  [I'm not totally
>> sure about this, because I cannot find the definition of java_error().]
>> The call to _() [aka gettext()] has to happen _before_ any other
>> transformations are done to the string, or the string won't match what
>> was put into the translation database.
>> 
>> Note also that java_lex_error() needs similar treatment.
>
> Crumbs! I saw this message just moments after I committed
> my changes. Sorry about that.
>
> However, I do not see an easy way out of this without
> perhaps redoing the error reporting bits (parse_*_context)
> and that might be too much for stage3...
>
> Do you want me to revert my commit or shall I proceed
> for the moment with using the new quoting style in the 
> messages?

You can go ahead.  My suggestions address problems which are
unrelated, but happen to touch the same area of code - hence "as long
as you're in there" in my original message.

zw


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