This is the mail archive of the gcc-bugs@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]

[Bug target/52726] New: Composed error message will not get translated


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52726

             Bug #: 52726
           Summary: Composed error message will not get translated
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: goeran@uddeborg.se


In config/tilepro/tilepro.c there is this code

    output_operand_lossage ("invalid %%t operand '"
                HOST_WIDE_INT_PRINT_DEC "'", n);

Normally, the first argument of "output_operand_lossage" is extracted for
translation.  When using string concatenation in this way it fails however, and
only the first part, "invalid %%t operand '", will get extracted.  At run time
however, the concatenated string would be used, which will not be available in
the translation catalog.

A trivial workaround would be to compose the format string at run time:

    sprintf (buf, gettext("invalid %%%%t operand '%s'"),
HOST_WIDE_INT_PRINT_DEC);
    output_operand_lossage (buf, n);


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