On Fri, May 22, 2020 at 01:50:44PM +0200, Marc Espie wrote: > uselocale is fine, but it is not on windows, so highly portable code tends to > prefer strtod_l...
The problem with uselocale is two fold and why I explicitly decided to not implement it in NetBSD: (1) It can come at a significant performance cost as all locale-aware operations need to access thread-specific memory. While that is moderate fast on x86, other architectures are not so nice. Even on x86, it can easily result a factor of two or three for things like the ctype.h macros. (2) It can easily POLA for code that different threads have differnt locales. There is a lot of existing code written that don't know how to deal with. Add that the explicit *_l functions are the preferred mechanism for implementing the primitives in higher languages and it becomes a no-brainer. Joerg