This is the mail archive of the gcc-bugs@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]

[Bug libstdc++/40712] locale(const locale&, const char*, locale::category) can create broken locale



------- Comment #2 from paolo dot carlini at oracle dot com  2009-07-11 19:43 -------
I think this constructor never ever worked correctly. The only solution I can
see at the moment is consistently dynamically allocating _M_data->_M_grouping,
and copying the characters of __nl_langinfo_l(__MON_GROUPING, __cloc) into it
as part of _M_initialize_moneypunct. The same for the other C strings, for
numpunct too, of course. Isn't such a big issue, after all, but I'm rather
surprised that we didn't notice the issue much earlier: destroying the __cloc
at the end of locale::_Impl::_Impl(const char*, size_t) after having referred
to the various __nl_langinfo_l(..., __cloc) in _M_initialize_moneypunct without
actually copying the data should unavoidably cause problems...


-- 

paolo dot carlini at oracle dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bkoz at redhat dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40712


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