bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: use of thread-unsafe localeconv in vasprintf


From: Simon Josefsson
Subject: Re: use of thread-unsafe localeconv in vasprintf
Date: Tue, 27 Mar 2007 16:56:29 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.95 (gnu/linux)

Bruno Haible <address@hidden> writes:

> Simon Josefsson wrote:
>> Actually, nl_langinfo is documented to need not be thread-safe:
>> 
>> http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_09.html
>
> And the same page lists also ecvt(), fcvt(), gcvt() as not being thread-safe.
> Argh.

My threadsafety script didn't find those, so FWIW, I don't need those
fixed.

>> Btw, can we use the system's native sprintf to get the locale-aware
>> decimal point in a thread-safe way?  sprintf is guaranteed to be
>> thread-safe, I believe.
>
> Yes, I finally had the same idea. How about this? We don't care much about
> efficiency at this point in the code.

Seems fine to me, thanks!  I will have to teach my threadsafety script
to avoid triggering on this usage though...

Stuffing this logic into a separate module might be cleaner though...
there is some duplicated code now.

/Simon




reply via email to

[Prev in Thread] Current Thread [Next in Thread]