bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

workaround against broken duplocale


From: Bruno Haible
Subject: workaround against broken duplocale
Date: Tue, 15 Aug 2017 21:28:26 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-91-generic; KDE/5.18.0; x86_64; ; )

Hi,

Running a gnulib testdir on NetBSD, I'm seeing a link error for test-duplocale.
This is due to the fact that the NetBSD people implemented duplocale() without
uselocale().
  https://mail-index.netbsd.org/tech-userlevel/2013/04/23/msg007714.html
Which is pretty senseless, since it forces programs to use functions that take
an explicit locale argument (fprintf_l, strfmon_l, and similar). The point
of standardizing duplocale(), newlocale(), uselocale() was to *eliminate*
the need for these non-standard *_l functions.

And on top of that, in NetBSD 7.0,
  - strfmon_l is not implemented,
  - duplocale(LC_GLOBAL_LOCALE) is broken.

I'm committing these workarounds:
  1) Extend the duplocale unit test so that it does meaningful tests even when
     uselocale() is not defined. Verified to work on glibc and macOS systems.
  2) Extend the duplocale autoconf test to recognize the broken behaviour on
     NetBSD.

@ Jörg Sonnenberger: Find attached a program (netbsd7-bug.c) that exhibits
the bug. Its exit code on NetBSD 7.0 is 2. The correct exit code is 0.

Bruno

Attachment: 0001-duplocale-tests-Verify-use-with-_l-functions.patch
Description: Text Data

Attachment: 0002-duplocale-Work-around-NetBSD-7.0-bug.patch
Description: Text Data

Attachment: netbsd7-bug.c
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]