Discussion:
nl_langinfo: new failure with glibc-2.26 and fedora 27
(too old to reply)
Jim Meyering
2018-02-04 02:40:26 UTC
Permalink
Raw Message
Hi Bruno,

I wanted to update sed to latest gnulib, but found that the new
nl_langinfo tests would fail on fedora 27 with glibc-2.26, where
nl_langinfo (ALTMON_1) returns the empty string:

FAIL: test-nl_langinfo.sh
=========================

test-nl_langinfo.c:95: assertion 'strlen (nl_langinfo (ALTMON_1)) > 0' failed
./test-nl_langinfo.sh: line 3: 10789 Aborted (core
dumped) LC_ALL=C ./test-nl_langinfo${EXEEXT} 0
FAIL test-nl_langinfo.sh (exit status: 1)
Bruno Haible
2018-02-04 10:04:33 UTC
Permalink
Raw Message
Hi Jim,

> I wanted to update sed to latest gnulib, but found that the new
> nl_langinfo tests would fail on fedora 27 with glibc-2.26, where
> nl_langinfo (ALTMON_1) returns the empty string:
>
> FAIL: test-nl_langinfo.sh
> =========================
>
> test-nl_langinfo.c:95: assertion 'strlen (nl_langinfo (ALTMON_1)) > 0' failed
> ./test-nl_langinfo.sh: line 3: 10789 Aborted (core
> dumped) LC_ALL=C ./test-nl_langinfo${EXEEXT} 0
> FAIL test-nl_langinfo.sh (exit status: 1)

I could swear I had tested this, but apparently I had only tested the
'langinfo' module, not the 'nl_langinfo' module. Fixed:


2018-02-04 Bruno Haible <***@clisp.org>

nl_langinfo: Override the system's nl_langinfo() when needed.
Reported by Jim Meyering.
* m4/nl_langinfo.m4 (gl_FUNC_NL_LANGINFO): Set REPLACE_NL_LANGINFO=1
also when HAVE_LANGINFO_T_FMT_AMPM or HAVE_LANGINFO_ALTMON is 0.

diff --git a/m4/nl_langinfo.m4 b/m4/nl_langinfo.m4
index 9ac25f0..82d4750 100644
--- a/m4/nl_langinfo.m4
+++ b/m4/nl_langinfo.m4
@@ -1,4 +1,4 @@
-# nl_langinfo.m4 serial 5
+# nl_langinfo.m4 serial 6
dnl Copyright (C) 2009-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -36,8 +36,11 @@ AC_DEFUN([gl_FUNC_NL_LANGINFO],
AC_DEFINE_UNQUOTED([FUNC_NL_LANGINFO_YESEXPR_WORKS],
[$FUNC_NL_LANGINFO_YESEXPR_WORKS],
[Define to 1 if nl_langinfo (YESEXPR) returns a non-empty string.])
- if test $HAVE_LANGINFO_CODESET = 1 && test $HAVE_LANGINFO_ERA = 1 \
- && test $FUNC_NL_LANGINFO_YESEXPR_WORKS = 1; then
+ if test $HAVE_LANGINFO_CODESET = 1 \
+ && test $HAVE_LANGINFO_T_FMT_AMPM = 1 \
+ && test $HAVE_LANGINFO_ALTMON = 1 \
+ && test $HAVE_LANGINFO_ERA = 1 \
+ && test $FUNC_NL_LANGINFO_YESEXPR_WORKS = 1; then
:
else
REPLACE_NL_LANGINFO=1
Jim Meyering
2018-02-04 10:36:04 UTC
Permalink
Raw Message
On Sun, Feb 4, 2018 at 11:04 PM, Bruno Haible <***@clisp.org> wrote:
> Hi Jim,
>
>> I wanted to update sed to latest gnulib, but found that the new
>> nl_langinfo tests would fail on fedora 27 with glibc-2.26, where
>> nl_langinfo (ALTMON_1) returns the empty string:
>>
>> FAIL: test-nl_langinfo.sh
>> =========================
>>
>> test-nl_langinfo.c:95: assertion 'strlen (nl_langinfo (ALTMON_1)) > 0' failed
>> ./test-nl_langinfo.sh: line 3: 10789 Aborted (core
>> dumped) LC_ALL=C ./test-nl_langinfo${EXEEXT} 0
>> FAIL test-nl_langinfo.sh (exit status: 1)
>
> I could swear I had tested this, but apparently I had only tested the
> 'langinfo' module, not the 'nl_langinfo' module. Fixed:
>
>
> 2018-02-04 Bruno Haible <***@clisp.org>
>
> nl_langinfo: Override the system's nl_langinfo() when needed.
> Reported by Jim Meyering.
> * m4/nl_langinfo.m4 (gl_FUNC_NL_LANGINFO): Set REPLACE_NL_LANGINFO=1
> also when HAVE_LANGINFO_T_FMT_AMPM or HAVE_LANGINFO_ALTMON is 0.

Hi Bruno,
Thank you for the quick fix.
I confirm it solves the problem for me.
Loading...