Bruno Haible
2017-08-15 19:28:26 UTC
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
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