Hi Assaf, > > +# elif defined __linux__ && HAVE_LANGINFO_H && defined NL_LOCALE_NAME > > + /* musl libc */ > > 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.
Yes, that's it. The refusal of the musl people to define a symbol such as __MUSL__ [1] makes it hard to write future-proof code. If someone else creates a platform that shares the same superficial characteristics (runs on Linux, has <langinfo.h> and NL_LOCALE_NAME) but behaves differently, we will accidentally run into the code intended for musl on that platform. Whereas the fallback code (return "" in this case) would be safer: it would make the unit test fail, but it would not lead to a compilation error or to a code dump. And if that platform does not have an identifiying macro either, we really got a problem how to distinguish the two. Bruno [1] https://wiki.musl-libc.org/faq.html