From owner-freebsd-current@FreeBSD.ORG Fri Aug 15 08:31:49 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F2A7CC0C for ; Fri, 15 Aug 2014 08:31:49 +0000 (UTC) Received: from mail.r61.net (mail.r61.net [195.208.245.238]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A73F029CA for ; Fri, 15 Aug 2014 08:31:49 +0000 (UTC) Received: from pyhalov.cc.rsu.ru (pyhalov.cc.rsu.ru [195.208.255.102]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: alp@sfedu.ru) by mail.r61.net (MTA) with ESMTPSA id 2D80FA60862 for ; Fri, 15 Aug 2014 12:31:45 +0400 (MSK) Message-ID: <53EDC571.6020003@rsu.ru> Date: Fri, 15 Aug 2014 12:31:45 +0400 From: Alexander Pyhalov User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130112 Thunderbird/17.0.2 MIME-Version: 1.0 To: freebsd-current@freebsd.org Subject: gcc / clang std::locale issue on non-glibc platforms Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-100.0 required=5.0 tests=UNPARSEABLE_RELAY, USER_IN_WHITELIST autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on mail.r61.net X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Aug 2014 08:31:50 -0000 Hello. I just stumped on the following gcc bug - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=15992 (std::locale is not working for non-C locales). It seems to affect all non-glibc platforms (reproducible on FreeBSD and illumos). Tried the same test with clang - no difference (as affected code is in libstdc++). Simple test case: $ cat t.cpp #include int main (int argc, char *argv[]) { for (int i = 1; i < argc; ++i) { try { const std::locale loc (argv [i]); } catch (std::exception &e) { printf ("exception: %s: %s\n", argv [i], e.what ()); } } } $ g++ -o locale t.cpp # or clang++ -o locale t.cpp , doesn't matter ./locale en_US.UTF-8 exception: en_US.UTF-8: locale::facet::_S_create_c_locale name not valid -- Best regards, Alexander Pyhalov, system administrator of Computer Center of Southern Federal University