This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

3.1 libstdc++ calls setlocale to format a number


I just noticed that in libstdc++ __convert_from_v template calls setlocale to 
format a number with sprintf.  

For me that does not sound a good idea, firstly because it is not MT safe 
(two threads using streams will corrupt your locale setting, or at least 
another thread is operating in the wrong "C" locale for a while), and 
setlocale is not necessarily very fast operation.  

Teemu


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]