Hello Bruno, On Sat, Feb 24, 2018 at 01:01:07PM +0100, Bruno Haible wrote: > On Alpine Linux 3.7.0, which uses musl libc, I see this test failure: [...] > diff --git a/lib/localename.c b/lib/localename.c > index 2133cbc..74c8ee0 100644 > --- a/lib/localename.c > +++ b/lib/localename.c > @@ -40,7 +40,7 @@ > # if defined __APPLE__ && defined __MACH__ > # include <xlocale.h> > # endif > -# if (__GLIBC__ >= 2 && !defined __UCLIBC__) || defined __CYGWIN__ > +# if (__GLIBC__ >= 2 && !defined __UCLIBC__) || (defined __linux__ && > HAVE_LANGINFO_H) || defined __CYGWIN__ > # include <langinfo.h> > # endif > # if !defined IN_LIBINTL > @@ -2703,6 +2703,9 @@ gl_locale_name_thread_unsafe (int category, const char > *categoryname) > nl_langinfo (_NL_LOCALE_NAME (category)). */ > name = thread_locale->__names[category]; > return name; > +# elif defined __linux__ && HAVE_LANGINFO_H && defined NL_LOCALE_NAME > + /* musl libc */ > + return nl_langinfo_l (NL_LOCALE_NAME (category), thread_locale);
A tiny comment about the comment :) You wrote "musl libc", but what the "elif defined ..." is something like "linux but not glibc, with langinfo.h" - which could (in theory) be something other than musl-libc. Specifically, musl people purposefully object to adding any kind of preprocessor #define value that would enable detection of musl: http://www.openwall.com/lists/musl/2013/02/08/9 And in a sense, this is exactly what we're detecting here. Perhaps it's worth expanding the comment to say "glibc not detected, assuming this is musl libc" ? regards, -assaf