[Bug libstdc++/40184] locale(const char* std_name) can create invalid facets for nonuniform locale

2009-05-18 Thread paolo dot carlini at oracle dot com


--- Comment #1 from paolo dot carlini at oracle dot com  2009-05-18 12:40 
---
Ok. Then, what do you think, would it be at least an improvement, constructing
on the fly a uniform locale corresponding to the LC_MONETARY category and
switching to it instead, before calling mbsrtowcs? Performance-wise, should not
be a big issue, because of caching.


-- 

paolo dot carlini at oracle dot com changed:

   What|Removed |Added

 CC||paolo dot carlini at oracle
   ||dot com
 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2009-05-18 12:40:14
   date||


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



[Bug libstdc++/40184] locale(const char* std_name) can create invalid facets for nonuniform locale

2009-05-18 Thread tsyvarev at ispras dot ru


--- Comment #2 from tsyvarev at ispras dot ru  2009-05-18 14:37 ---
Yes, this seems reasonably. I also thought about smth. similar to this. Only it
is need to take into account using mbsrtowcs for other locale properties(if
they exist in others categories).

Anyway, checking of mbsrtowcs result could be usefull, at least for terminate
resulting string with '\0' if mbsrtowcs cannot convert input string for some
reason. E.g., there is a system where mbsrtowcs() cannot convert every
non-ASCII character, but all other locale features work correctly.


-- 


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



[Bug libstdc++/40184] locale(const char* std_name) can create invalid facets for nonuniform locale

2009-05-18 Thread paolo dot carlini at oracle dot com


--- Comment #3 from paolo dot carlini at oracle dot com  2009-05-18 15:03 
---
Ok, thanks.


-- 

paolo dot carlini at oracle dot com changed:

   What|Removed |Added

 CC|paolo dot carlini at oracle |
   |dot com |
 AssignedTo|unassigned at gcc dot gnu   |paolo dot carlini at oracle
   |dot org |dot com
 Status|NEW |ASSIGNED


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



[Bug libstdc++/40184] locale(const char* std_name) can create invalid facets for nonuniform locale

2009-05-19 Thread paolo at gcc dot gnu dot org


--- Comment #4 from paolo at gcc dot gnu dot org  2009-05-19 18:20 ---
Subject: Bug 40184

Author: paolo
Date: Tue May 19 18:20:47 2009
New Revision: 147714

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=147714
Log:
2009-05-19  Paolo Carlini  

PR libstdc++/40184
* include/bits/locale_classes.h (locale::facet::_S_lc_ctype_c_locale):
Declare...
* config/locale/gnu/c_locale.cc: ... and define.
* config/locale/generic/c_locale.cc: Define.
* src/localename.cc (locale::_Impl::_Impl(const char*, size_t)):
Use it.
* testsuite/22_locale/locale/cons/40184.cc: New.

Added:
trunk/libstdc++-v3/testsuite/22_locale/locale/cons/40184.cc
Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/config/locale/generic/c_locale.cc
trunk/libstdc++-v3/config/locale/gnu/c_locale.cc
trunk/libstdc++-v3/include/bits/locale_classes.h
trunk/libstdc++-v3/src/localename.cc


-- 


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



[Bug libstdc++/40184] locale(const char* std_name) can create invalid facets for nonuniform locale

2009-05-19 Thread paolo dot carlini at oracle dot com


--- Comment #5 from paolo dot carlini at oracle dot com  2009-05-19 18:24 
---
Fixed.


-- 

paolo dot carlini at oracle dot com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED
   Target Milestone|--- |4.5.0


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