Re: c-strtod threading and documentation problems

2009-01-22 Thread Michael Gold
On Wed, Jan 21, 2009 at 12:39:50 +0100, Bruno Haible wrote: > Yes. While the strtod specification explains the locale dependency of the > decimal point, it does not do so for the digits; hence it's safe to assume > that the digits understood by strtod are only '0'..'9'. Actually, C99 states 'In ot

Re: c-strtod threading and documentation problems

2009-01-20 Thread Michael Gold
On Tue, Jan 20, 2009 at 23:26:49 +0100, Bruno Haible wrote: > It is correct that perfect decimal to binary conversion requires an > amount of memory that is proportional to the absolute value of the > exponent, and that requires a malloc(). But strtod is allowed to fail > with ENOMEM. See POSIX: T

Re: c-strtod threading and documentation problems

2009-01-19 Thread Michael Gold
On Sun, Jan 18, 2009 at 03:42:29 +0100, Bruno Haible wrote: > The module 'c-strtod' is under GPL, not LGPL. This alone is enough of a > hint that the function is not really usable in libraries. I don't agree that this is a good enough hint, since some libraries are licensed under the GPL (includin

c-strtod threading and documentation problems

2009-01-13 Thread Michael Gold
Hi, I was planning to use the c-strtod module in a library, but noticed some problems when looking at its implementation. On platforms without strtod_l, it saves the current locale, switches to "C" using setlocale, calls strtod, and restores the old locale. This is not threadsafe because setlocal