From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 103380 invoked by alias); 1 Oct 2016 14:58:23 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 103074 invoked by uid 89); 1 Oct 2016 14:58:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.4 required=5.0 tests=AWL,BAYES_40,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=calgary, Calgary, inglis, Inglis X-HELO: smtp-out-no.shaw.ca Received: from smtp-out-no.shaw.ca (HELO smtp-out-no.shaw.ca) (64.59.134.12) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 01 Oct 2016 14:58:12 +0000 Received: from [192.168.1.100] ([174.0.238.184]) by shaw.ca with SMTP id qLjtbOxzPFfiXqLjubUDlu; Sat, 01 Oct 2016 08:58:10 -0600 X-Authority-Analysis: v=2.2 cv=Qb8khYTv c=1 sm=1 tr=0 a=WqCeCkldcEjBO3QZneQsCg==:117 a=WqCeCkldcEjBO3QZneQsCg==:17 a=IkcTkHD0fZMA:10 a=FP58Ms26AAAA:8 a=mV9VRH-2AAAA:8 a=yS8ZTNyj3a3Raj9aliMA:9 a=QEXdDO2ut3YA:10 a=bKJ81ofCEp0A:10 a=t9tyYGze7rQA:10 a=6LVbBl2NLSWPyIBDCKCu:22 a=BYZmueQyWBbq8FANvIHb:22 Reply-To: Brian.Inglis@SystematicSw.ab.ca Subject: Re: c++0x and locale_t References: To: cygwin@cygwin.com From: Brian Inglis Message-ID: Date: Sat, 01 Oct 2016 15:52:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4wfPcLReShlLZB5UFQrLEN4B7QJMHyQZiGVKZ9JKDjvWRtP2TL4e2f7ijUf5rbN0B86F2/h7rxayP8+b7oz0sOm5nFnfATbm0uF94ztlETYKgaw9cnCjct tj5CjHmMhuZYiWmxmMi2P7sCtqeXUIyJFyf6bE7FwQWiop0Lyv+IpZcwxQ5XfimcMLt06lYNyFBxOg== X-IsSubscribed: yes X-SW-Source: 2016-10/txt/msg00005.txt.bz2 On 2016-10-01 07:30, Ken Brown wrote: > I'm having an issue building icu, which boils down to the following > test case: > $ cat foo.cc > #include > locale_t foo; > $ g++ -c --std=c++0x foo.cc > foo.cc:2:1: error: ‘locale_t’ does not name a type > locale_t foo; > ^ > If I remove '--std=c++0x', the error goes away. I know nothing about > C++ standards, so I don't know if this is expected behavior or if it > indicates a bug in Cygwin's headers. For C POSIX locale_t support, you have to do one or both of: #define _XOPEN_SOURCE 700 #define _POSIX_C_SOURCE 200809L to support multiple dynamic C locales and related functions. This may be done automatically if you use the default -std=gnu++03, which may have been the intent in ICU and original interpretation by g++. g++ now interprets (and deprecates) c++0x to mean c++11. You could try changing it to explicitly c++03 and see if it works, without the GNU extensions. Otherwise you should change it to explicitly gnu++03, as c++0x is deprecated, and may be dropped; g++ also deprecates c++1y aka c++14 and c++1z which may be c++17, and their gnu++ counterparts. I don't understand why ICU C++ would use C locales, when C is now trying to add a subset of features C++ has supported better, more flexibly in for over a decade; see: https://sourceforge.net/p/msys2/discussion/general/thread/23e1b5ce/ for a similar problem to yours, and the solution in standard C++; and: http://stdcxx.apache.org/doc/stdlibug/24-3.html for an explanation of the differences between C++ and C locales. OTOH ICU comes from IBM, and may be more interested in consistency across languages: how else can you explain C++ methods called createInstance? But you may just be the packager, porter, and builder, so may be unable to fix the implementation. -- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple