Bug 47081 - Macro usage too clever for localization
Summary: Macro usage too clever for localization
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks: 40883
  Show dependency treegraph
 
Reported: 2010-12-28 19:19 UTC by Göran Uddeborg
Modified: 2010-12-28 19:44 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Göran Uddeborg 2010-12-28 19:19:09 UTC
In gcc/gentype-state.c there is a macro like this:

#define fatal_reading_state_printf(Tok,Fmt,...) do {	\
...
      fatal ("%s:%d:%d: Invalid state file; " Fmt,	\

Normally, the first argument to fatal() is extracted for localization.  But that extraction apparently fails here.  Each usage of the macro will create a unique format string to fatal().  But the extractor for localization only extracts the invariant part that is in the macro, "%s:%d:%d: Invalid state file; ".  That will never be the string looked up for translation at run time.  And the strings actually looked up are not available in the pot file.

Seen in the po file distributed for 4.6-b20101218.
Comment 1 Andrew Pinski 2010-12-28 19:21:25 UTC
I don't know if generator files should be have translated error messages.  Unlike other programs, the gen* programs are only used internally inside gcc.
Comment 2 Göran Uddeborg 2010-12-28 19:23:57 UTC
Oh, I see.  You mean this message is never seen by an end user?  In that case, maybe they could be excluded from the set of files scanned for messages to translate?  Or would that be complex?
Comment 3 joseph@codesourcery.com 2010-12-28 19:44:02 UTC
On Tue, 28 Dec 2010, pinskia at gcc dot gnu.org wrote:

> I don't know if generator files should be have translated error messages. 
> Unlike other programs, the gen* programs are only used internally inside gcc.

If Basile's proposal to install gengtype goes ahead, then maybe it should 
all be properly internationalized.  Otherwise, gengtype-state.c should be 
added to po/EXCLUDES.