[PATCH v2 2/2] assert: Remove the use of %n from __assert_fail_base (BZ #32456)

Maciej W. Rozycki macro@orcam.me.uk
Fri Jan 3 04:33:50 GMT 2025


On Mon, 30 Dec 2024, Adhemerval Zanella Netto wrote:

> >> diff --git a/po/libc.pot b/po/libc.pot
> >> index d66bd04122..c8193f53c7 100644
> >> --- a/po/libc.pot
> >> +++ b/po/libc.pot
> >> @@ -6,7 +6,7 @@
> >>  msgid ""
> >>  msgstr ""
> >>  "Project-Id-Version: libc 2.40.9000\n"
> >> -"POT-Creation-Date: 2024-12-30 16:29-0300\n"
> >> +"POT-Creation-Date: 2024-12-30 16:34-0300\n"
> >>  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
> >>  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
> >>  "Language-Team: LANGUAGE <LL@li.org>\n"
> >> @@ -102,16 +102,12 @@ msgstr ""
> >>  
> >>  #: assert/assert-perr.c:35
> >>  #, c-format
> >> -msgid ""
> >> -"%s%s%s:%u: %s%sUnexpected error: %s.\n"
> >> -"%n"
> >> +msgid "%s%s%s:%u: %s%sUnexpected error: %s.\n"
> >>  msgstr ""
> >>  
> >> -#: assert/assert.c:132
> >> +#: assert/assert.c:125
> >>  #, c-format
> >> -msgid ""
> >> -"%s%s%s:%u: %s%sAssertion `%s' failed.\n"
> >> -"%n"
> >> +msgid "%s%s%s:%u: %s%sAssertion `%s' failed.\n"
> >>  msgstr ""
> >>  
> >>  #: catgets/gencat.c:111
> > 
> > I would have expect po/*.po file updates, too.
> 
> These are from translation teams and current instruction is to not change
> it locally [1].  
> 
> [1] https://sourceware.org/glibc/wiki/Regeneration

 As per Andreas's note perhaps it does not matter in this particular case, 
but overall ISTM that such a change ought to really be done in two steps:

1. Remove "%n" from the reference (English) message string and rather than 
   deleting the corresponding pointer argument *replace* it with a pointer 
   to a dummy otherwise unused variable.

2. Only remove the dummy variable and the referring pointer argument once 
   all the translations have been regenerated, perhaps after a release has 
   been made.

 FWIW,

  Maciej


More information about the Libc-alpha mailing list