delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/10/02/11:09:58

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=WBDDzFTV51ooSWL6
oIE1MJhc3B2dlitwhANMTIayfkVs6u32osuUcE6zaznacdvmghgcPstOWEu2KmxA
ovq0TpjMnqUNYuZ7pNIvbOd6f9qKIBcjYreedhVpyt7wfPMykAdHP90PeX6gANYE
XDd8kbCiq8t5sV74HKzJuJd2gic=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=TfM14jOx7+5Q6jJJl9Pdvy
3/AFE=; b=qJ4CpI1VXYW2u8GZd8GJWYtOkKgGfDn8I77l3q9bS2OOubITqa/iHD
xhnQpDszknmhsRrmR+O5XatGy8eVxFroq8RZjiwIDFk9MR6ZJeNczVbIS3og/k7B
ukLmPzfhTxfkY/TBiM4FrfRUGs1J2RToIqtly15FOpC+h2SVOwizY=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-4.8 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=H*i:sk:d62d5b0, H*f:sk:d62d5b0, H*MI:sk:d62d5b0, yours
X-HELO: limerock01.mail.cornell.edu
X-CornellRouted: This message has been Routed already.
Subject: Re: c++0x and locale_t
To: cygwin AT cygwin DOT com
References: <af127659-63ef-96ba-60f9-3bf17f70e6c1 AT cornell DOT edu> <d62d5b0c-3702-62f5-f1c9-d470404fae94 AT SystematicSw DOT ab DOT ca>
From: Ken Brown <kbrown AT cornell DOT edu>
Message-ID: <be9be35f-578e-b1f3-226a-50d02ea3eb33@cornell.edu>
Date: Sun, 2 Oct 2016 11:09:23 -0400
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: <d62d5b0c-3702-62f5-f1c9-d470404fae94@SystematicSw.ab.ca>
X-PMX-Cornell-Gauge: Gauge=XXXXX
X-PMX-CORNELL-AUTH-RESULTS: dkim-out=none;
X-IsSubscribed: yes

On 10/1/2016 10:58 AM, Brian Inglis wrote:
> 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.h>
>> 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 <locale>
> 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.

Thanks for the information.  I've submitted a patch upstream.

Ken


--
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019