std::locale on Freebsd 9.1

Jonathan Wakely jwakely.gcc@gmail.com
Wed Jul 17 09:43:00 GMT 2013


On 17 July 2013 02:30, Sam Varshavchik wrote:
> Jonathan Wakely writes:
>
>> Even if it's used I'm not sure how well named locales work with the
>> darwin model, I think they fail even on Mac OS X for anything except
>> "C" and "POSIX", so maybe the same is true of FreeBSD. The closest
>> thing I have to a reference for that is Bug ID# 13969869 for
>> http://bugreport.apple.com but I can't see that report myself.
>
>
> Looking around FreeBSD's man pages, all the moving pieces seem to be in
> order. There's a locale_t. There's uselocale, duplocale, freelocale,
> newlocale. There's an xlocale(3) man page.
>
> I haven't banged on xlocale support in FreeBSD 9.1, have no idea how solid
> it is. It's entirely possible that it's missing chunks of functionality, but
> a casual observation suggests that the API, itself, is complete.

The problem could be in the libstdc++ code used by
--enable-clocale=darwin, I think that code was contributed by Apple
shortly before they ceased all involvement with GCC and it's pretty
much unmaintained.

> Looking at configure, the locale setting is mapped straight from the
> platform, rather than heuristically probed, but there appears to be an
> --enable-clocale that, from the looks of it, can be used to force a
> particular locale implementation. So, I'll play with --enable-clocale=gnu,
> see how far I get.

I doubt that will work on non-glibc targets, it relies on GNU-specific
implementation details such as __uselocale.

One day I plan to make a new model based on the GNU one that will work
on more targets, see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57585



More information about the Libstdc++ mailing list