This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/40712] locale(const locale&, const char*, locale::category) can create broken locale
- From: "paolo dot carlini at oracle dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Jul 2009 19:43:19 -0000
- Subject: [Bug libstdc++/40712] locale(const locale&, const char*, locale::category) can create broken locale
- References: <bug-40712-16694@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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