[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: POSIX msgfmt and duplicate msgids
From: |
Bruno Haible |
Subject: |
Re: POSIX msgfmt and duplicate msgids |
Date: |
Thu, 12 May 2022 01:08:09 +0200 |
Eric Blake wrote:
> In the msgfmt(1) utility, there is currently a difference between GNU
> and Illumos implementations on detecting duplicate msgid strings, and
> which command line switch(es) make detection of duplicates possible.
> The question is whether GNU msgfmt would be willing to use the current
> -c option (--check) have a mode for erroring out on duplicate msgid
> strings, or even adding a new command line option (-n appears to be
> available, for a mnemonic of 'no dupes') to have the duplicate
> detection available without requiring -c.
https://posix.rhansen.org/p/gettext_draft
Lines 925..926, 1140
"-n Do not allow duplicate msgid directives. Treat duplicate msgid
directives for the same message_identifier as errors instead of
ignoring the duplicates."
This does not deserve a specific option. *Of course* an input file with
duplicate msgids is abnormal; this is like a C file that defines two
functions with the same name. And that implies that when invoked with
-c and -v, the 'msgfmt' program must produce an error.
None of the following has this '-n' option:
- The LI18NUX 2000 specification
- GNU msgfmt
https://www.gnu.org/software/gettext/manual/html_node/msgfmt-Invocation.html
- Solaris msgfmt
https://docs.oracle.com/cd/E88353_01/html/E37839/msgfmt-1.html
When '-c' and '-v' are *not* specified, I don't care whether the standard
requires msgfmt to diagnose this abnormality of the input. But it should
definitely not prohibit it.
Suggestion:
Remove these lines.
> The question is whether GNU msgfmt would be willing to use the current
> -c option (--check) have a mode for erroring out on duplicate msgid
> strings
It doesn't need a mode for that. GNU msgfmt already errors out on
duplicate msgids, even without '-c'.
Bruno