This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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]

Re: generic locale


. o O (Loren, reading list mail on the weekend? what the-?)

On Sat, Feb 22, 2003 at 02:10:43AM -0600, Loren James Rittle wrote:
> (a) keep the status quo; do not throw exceptions for e.g.:
>       locale loc_de("de_DE"); istringstream iss; iss.imbue(loc_de);
>     even though they have no effect on input handling, etc.

I think we can all agree this leads to serious user confusion.

> (b) At least throw an exception in generic for all user instantiations
>     of locale() objects unless they map to the "C" (or ""?) locale.

Can go for this as a short-term solution, sure.  Especially if the
exeception's what() includes something along the lines of "this is a
temporary band-aid, see http:.....".

> (c) make generic work for single-threaded programs no matter how slow
>     it is; use my system's libc dammit (note: the status quo is already
>     broken w.r.t. threading since any unguarded call to setlocale()
>     are unsafe and we would have no idea what users might do outside
>     the library code)
> 
> (d) make generic work for multi-threaded programs (as long as all IO
>     is C++-style, see note in c) no matter how slow it is; use my
>     system's libc dammit

Apart from the threading issues, we should have a UMSLD ("use my...") mode
for all non-glibc platforms, --enable-umsld perhaps.  No, I have no idea
how to make this work in generic, but it sounds like a win for porting.

> (e) make generic work for multi-threaded programs (a small race would
>     remain against user programs with threads of control that called
>     setlocale() directly but protect internal library use); use C89
>     locale calls only to fetch "struct lconv" from OS but otherwise
>     assume that IO conversions are now disconnected from libc

I don't know enough to have an opinion.

> (f) do whatever you want Loren but put it in 'enhanced-generic' which
>     is cloned off generic to start

That sounds like an excellent idea.

Nor do I have any additional suggestions to fill in the [g-y] gap.

> Comments?  Are people starting to care about C++ locale support?  I
> admit that I am one of those "one-language speaking" Americans that
> knows little beyond the fact that the English actually speak a
> different language than us. ;-)

I'd like to repeat Loren's disclaimer for myself.  I have dim memories
of studying German.  My French has long since bitrotted -- all I remember
is that I really like the cheese -- and my Russian is going the same way.
(Truly, if you don't use it, ya lose it.)  This is why I've been avoiding
the locale work lately; I'm not really qualified to say how proposed patch
X would impact actual user Y.


Phil

-- 
If ye love wealth greater than liberty, the tranquility of servitude greater
than the animating contest for freedom, go home and leave us in peace.  We seek
not your counsel, nor your arms.  Crouch down and lick the hand that feeds you;
and may posterity forget that ye were our countrymen.            - Samuel Adams


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