Translation of string "Dynamic section at offset %#<PRIx64> contains %<PRId64> entry:" cannot be updated as used format does not match plural from "Dynamic section at offset %#<PRIx64> contains %<PRIu64> entries:".
Let see code printf (ngettext ("\nDynamic section at offset %#" PRIx64 " contains %" PRId64 " entry:\n", "\nDynamic section at offset %#" PRIx64 " contains %" PRIu64 " entries:\n", filedata->dynamic_nent), Singular form uses PRId64 while in plural is used PRIu64. As result update of existing "fuzzy" translation fail: binutils-2.39.90.bg.po: binutils-2.39.90.bg.po:9352: format specifications in 'msgid_plural' and 'msgstr[0]' for argument 2 are not the same msgfmt: found 1 fatal error. Work-around: to update translated text to use PRIu64 format.
> Work-around: to update translated text to use PRIu64 format. I don't know what you mean. The bug is not the translation; the bug is in the source code that led to the POT file with this contents: #: readelf.c:11554 #, c-format msgid "" "\n" "Dynamic section at offset %#<PRIx64> contains %<PRId64> entry:\n" msgid_plural "" "\n" "Dynamic section at offset %#<PRIx64> contains %<PRIu64> entries:\n" msgstr[0] "" msgstr[1] "" The second argument to the C format string can be EITHER signed OR unsigned, not both. It makes no sense for the programmer to specify that it is signed in one case and unsigned in the other case.
Hi Bruno, I would like to inform you about such kind of errors in gettext use. Definitely it is developer error, not gettext! As gettext enhancement could be added check on extract time. But this is feature request, with very low severity and zero priority. May be some one would like to work on such enhancements.
Work-around means in translated singular form, i.e., msgstr[0] to use PRIu64 instead PRId64.
> As gettext enhancement could be added check on extract time. But this is > feature request, with very low severity and zero priority. Registered at https://savannah.gnu.org/bugs/?63630 .
The master branch has been updated by Alan Modra <amodra@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=02da71ee20ec71f7b3be85cf2266e09c124983bf commit 02da71ee20ec71f7b3be85cf2266e09c124983bf Author: Alan Modra <amodra@gmail.com> Date: Sun Jan 8 13:08:46 2023 +1030 PR29972, inconsistent format specification in singular form PR 29972 * readelf.c (process_dynamic_section): Correct format string.
The binutils-2_40-branch branch has been updated by Alan Modra <amodra@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=48d455786ce177ed8f8ebe4a868581f591ad81b5 commit 48d455786ce177ed8f8ebe4a868581f591ad81b5 Author: Alan Modra <amodra@gmail.com> Date: Sun Jan 8 13:08:46 2023 +1030 PR29972, inconsistent format specification in singular form PR 29972 * readelf.c (process_dynamic_section): Correct format string. (cherry picked from commit 02da71ee20ec71f7b3be85cf2266e09c124983bf)
Fixed both mainline and branch