mbox

[v2,0/2] Improve LC_MONETARY handling.

Message ID 20220224214547.911386-1-carlos@redhat.com
Headers

Message

Carlos O'Donell Feb. 24, 2022, 9:45 p.m. UTC
  In glibc 2.35 we released C.UTF-8, but if you try to compile
the locale without '-c' you get the following error:

localedef -i C -f UTF-8 C.UTF-8
[error] LC_MONETARY: value for field `mon_decimal_point' 
        must not be an empty string
[error] no output file produced because errors were issued

The first patch in the series fixes bug 28845 and cleans up
LC_MONETARY handling in ld-monetary.c (monetary_finish) 
for default values and generated errors. In general we 
downgrade the errors and make them warnings.

Lastly, to prevent this from happening again we remove the
'-c' from glibc localedef uses since we do not want to force
output generation and we should always have locales that
compile cleanly.

Where locales are not clean we should implement specific
warning disabling e.g. --no-warnings=ascii for SHIFT_JIS
and SHIFT_JISX0213 (non-ascii locales). Any future locale
warnings should fail during locale compilation (install
or testing).

Changes from v1:
  - Fix spelling mistakes in ld-monetary.c
  - Expand comments for mon_grouping to explain "\177" oddity.
  - Keep @flags="" in Makefile for future debugging uses.

Carlos O'Donell (2):
  localedef: Update LC_MONETARY handling (Bug 28845)
  localedata: Do not generate output if warnings were present.

 locale/programs/ld-monetary.c | 182 +++++++++++++++++++++++++++-------
 localedata/Makefile           |   3 +-
 localedata/gen-locale.sh      |  10 +-
 3 files changed, 155 insertions(+), 40 deletions(-)