This is the mail archive of the
mailing list for the GCC project.
Re: one idea for next GSoC: libstdc++ locale support based on POSIX 2008 duplocale/uselocale, etc.
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Václav Zeman <vhaisman at gmail dot com>
- Cc: GCC Development <gcc at gcc dot gnu dot org>, Jakub Jelinek <jakub at redhat dot com>
- Date: Mon, 25 Nov 2013 12:09:36 +0000
- Subject: Re: one idea for next GSoC: libstdc++ locale support based on POSIX 2008 duplocale/uselocale, etc.
- Authentication-results: sourceware.org; auth=none
- References: <52928341 dot 3030409 at gmail dot com> <20131124235530 dot GR892 at tucnak dot redhat dot com> <5292F23B dot 9040508 at gmail dot com>
On 25 November 2013 06:46, Václav Zeman wrote:
> On 11/25/2013 12:55 AM, Jakub Jelinek wrote:
>> On Sun, Nov 24, 2013 at 11:52:49PM +0100, Václav Zeman wrote:
>>> Here is one idea for GSoC: Implement C++ locale support in libstdc++
>>> based on POSIX 2008 uselocale()/duplocale() facilities.
See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57585 and various
posts I've made to the libstdc++ list discussing the same thing.
>> Doesn't glibc do that since 2002?
> Glibc does seem to have the locale facilities mentioned above. Since
> when does it have the facilities? I do not know. Are they used in
> libstdc++'s `std::locale` implementation? Yes and no. The 'gnu' style
Which is the default on *-gnu targets.
> (`--enable-clocale=gnu` configure option) implementation uses the
> POSIX 2008 functions but it also uses `typedef __locale_t __c_locale`,
> i.e., the Glibc internal type instead of `locale_t`. The implementation
> in `libstdc++-v3/config/locale/gnu` is also riddled with Glibc version
> checking preprocessor directives.
Why is that a problem in practice?
Even if we add a new locale model, we won't get rid of the gnu one, so
won't be able to clean up that code significantly.
> What I am proposing is that somebody takes the pure POSIX 2008 API and
> implements `std::locale` on top of that.
This would be helpful for non-GNU platforms, but would not add any
functionality for glibc-based targets, which already have a fully
functional <locale> implementation using the GNU-specific features.