Ben Pfaff <[EMAIL PROTECTED]> writes: > Bruno Haible <[EMAIL PROTECTED]> writes: > >> Simon Josefsson wrote: >>> Why can we assume setlocale exists? >>> Is it POSIX? >> >> Even more: It's specified by ISO C 99. > > Even more than that: it's in C90 also.
Yes, that's the key point: it was in ISO C90 aka ANSI C89. But even more than that: setlocale was in XPG3, and therefore in SunOS 4 (introduced 1989, last shipped to customers on 1998-09-30), which for many years was the oldest Unix that could conceivably be a target of modern GNU apps. You have to go back to something like SVR3 (introduced 1986, probably last shipped to customers around 1990) to find a system that lacks setlocale, but SVR3 is 100% dead now. Theoretically we might still have problem with setlocale, since freestanding C implementations are not required to supply setlocale or <locale.h> -- this is true even for C99. But if this turns into a real problem, we can write a setlocale module that supplies a no-op substitute.