stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <se...@roguewave.com>
Subject Re: [PATCH] 22.locale.ctype.is.cpp
Date Tue, 20 Nov 2007 15:10:59 GMT
Farid Zaripov wrote:
>> -----Original Message-----
>> From: Martin Sebor [mailto:sebor@roguewave.com] 
>> Sent: Monday, November 19, 2007 8:30 PM
>> To: stdcxx-dev@incubator.apache.org
>> Subject: Re: [PATCH] 22.locale.ctype.is.cpp
>>
>> Martin Sebor wrote:
>>> Seems reasonable. We should also guard the calls to the the wchar_t 
>>> specializations of the function with _RWSTD_NO_WCHAR_T.
>> On second thought, isn't there a more robust way of fixing 
>> this, one that makes it work regardless of the order of the 
>> calls to the function? E.g., have the function that needs the 
>> environment variable defined always define it and the one 
>> that needs it undefined always undefine it?
> 
>   The environment variable is defined in rw_create_locale() by invoking
> rw_set_locale_root (). But rw_create_locale() designed to set
> environment
> variable and exec localedef utility only once.

That sounds like a design limitation of rw_create_locale(), don't
you think? It seems there should be a way to switch back to the libc
locale implementation...

> 
>   But we can save the variable value in test_libc(), then undefine it
> and
> restore the value at the end of the function.

...such as this :)

I guess this would work. Although I'm not sure I'm completely
comfortable with this approach either. It seems that the functions
shouldn't have to worry about these details (i.e., that some other
functions might have switched things around underneath them before
they were called). They should "just work" :) Maybe we should just
document the current behavior and be done with it. It's your call.

Martin

Mime
View raw message