Hi Nick

I just tested a message like this:

#: coff-sh.c:2780 cofflink.c:2964
#, c-format
msgid "%B: illegal symbol index %ld in relocs"
msgstr "%A: advarsel: illegalt symbolindeks %ld i relokeringerne"

Note how the translation contains an erroneous %A instead of the correct %B.

This is accepted by msgfmt.  Thus, the c-format flag cannot validate
these codes.  It also accepts the message if %A or %B is omitted.

The reason why msgfmt does not recognize them is that the %A/%B codes
are defined by the error handler (bfd.c around line 600).   Meanwhile,
msgfmt is only aware of the codes of printf.

I see "/* Invoking %A with a null section pointer is an internal
error.  */", followed by abort(), which means that superficially valid
translation files can very easily result in abort() or possibly buffer
overruns.

My recommendation is to use the same string codes as printf.  Then
faulty translations will be rejected by translationproject.

I wrote a script to verify existing translations on the web page, and
those that I tested had at least a few errors each.

Best regards
Ask


2016-10-20 12:47 GMT+02:00 Nick Clifton <ni...@redhat.com>:
> Hi Ask,
>
>> Do you know when the translation
>> templates on translationproject.org will be updated?
>
> On translationproject.org - no.  But I have just updated the
> bfd.pot template in the binutils source repository (which I
> forgot to do yesterday, sorry).
>
> Cheers
>   Nick
>

_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to