From owner-freebsd-toolchain@FreeBSD.ORG Thu Nov 22 23:09:14 2012 Return-Path: Delivered-To: toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 45E3881D for ; Thu, 22 Nov 2012 23:09:14 +0000 (UTC) (envelope-from yamayan@kbh.biglobe.ne.jp) Received: from rcpt-expgw.biglobe.ne.jp (rcpt-expgw.biglobe.ne.jp [IPv6:2001:260:401:16::1]) by mx1.freebsd.org (Postfix) with ESMTP id 2D5E88FC14 for ; Thu, 22 Nov 2012 23:09:12 +0000 (UTC) Received: from vc-gw.biglobe.ne.jp by rcpt-expgw.biglobe.ne.jp (shby/5910021009) with SMTP id qAMN9BtQ025905 for ; Fri, 23 Nov 2012 08:09:11 +0900 Received: from smtp-gw.biglobe.ne.jp ([172.21.175.155]) by vc-gw.biglobe.ne.jp (kbkr/0716090908) with ESMTP id qAMN9Bp9007864 for ; Fri, 23 Nov 2012 08:09:11 +0900 X-Biglobe-Sender: Received: from [192.168.0.100] (KD027083060020.ppp-bb.dion.ne.jp [27.83.60.20]) by smtp-gw.biglobe.ne.jp id IAAOAC15AFDB; Fri, 23 Nov 2012 08:09:11 +0900 (JST) Message-ID: <50AEB0A1.3090803@kbh.biglobe.ne.jp> Date: Fri, 23 Nov 2012 08:09:21 +0900 From: Yamaya Takashi User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: toolchain@freebsd.org Subject: [patch][libc++]using some undeclared functions with -std=c++98, -std=c++03 or -ansi Content-Type: multipart/mixed; boundary="------------050504010505010207000702" X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2012 23:09:14 -0000 This is a multi-part message in MIME format. --------------050504010505010207000702 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit hi With -std=c++98, -std=c++03 or -ansi, __LONG_LONG_SUPPORTED is not defined. So some functions((lldiv_t, )atoll, strtoll, strtoull, llabs, lldiv, wcstoll, wcstoull) are undeclared. But libc++ headers(cstdlib and cwchar) use them. --------------050504010505010207000702 Content-Type: text/plain; charset=UTF-8; name="libcxx.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="libcxx.patch" SW5kZXg6IGNvbnRyaWIvbGliYysrL2luY2x1ZGUvY3N0ZGxpYgo9PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0t LSBjb250cmliL2xpYmMrKy9pbmNsdWRlL2NzdGRsaWIJKHJldmlzaW9uIDI0MTkyNykKKysr IGNvbnRyaWIvbGliYysrL2luY2x1ZGUvY3N0ZGxpYgkod29ya2luZyBjb3B5KQpAQCAtOTcs MTggKzk3LDI2IEBACiB1c2luZyA6OnNpemVfdDsKIHVzaW5nIDo6ZGl2X3Q7CiB1c2luZyA6 OmxkaXZfdDsKKyNpZmRlZiBfX0xPTkdfTE9OR19TVVBQT1JURUQKIHVzaW5nIDo6bGxkaXZf dDsKKyNlbmRpZgogdXNpbmcgOjphdG9mOwogdXNpbmcgOjphdG9pOwogdXNpbmcgOjphdG9s OworI2lmZGVmIF9fTE9OR19MT05HX1NVUFBPUlRFRAogdXNpbmcgOjphdG9sbDsKKyNlbmRp ZgogdXNpbmcgOjpzdHJ0b2Q7CiB1c2luZyA6OnN0cnRvZjsKIHVzaW5nIDo6c3RydG9sZDsK IHVzaW5nIDo6c3RydG9sOworI2lmZGVmIF9fTE9OR19MT05HX1NVUFBPUlRFRAogdXNpbmcg OjpzdHJ0b2xsOworI2VuZGlmCiB1c2luZyA6OnN0cnRvdWw7CisjaWZkZWYgX19MT05HX0xP TkdfU1VQUE9SVEVECiB1c2luZyA6OnN0cnRvdWxsOworI2VuZGlmCi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l IF9MSUJDUFBfSU5MSU5FX1ZJU0lCSUxJVFkgbGxkaXZfdCBkaXYobG9uZyBsb25nIF9feCwg bG9uZyBsb25nIF9feSkgX05PRVhDRVBUIHtyZXR1cm4gbGxkaXYoX194LCBfX3kpO30KKyNl bmRpZgogI2VuZGlmIC8vIF9NU0NfVkVSCiAKIF9MSUJDUFBfRU5EX05BTUVTUEFDRV9TVEQK SW5kZXg6IGNvbnRyaWIvbGliYysrL2luY2x1ZGUvY3djaGFyCj09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0t IGNvbnRyaWIvbGliYysrL2luY2x1ZGUvY3djaGFyCShyZXZpc2lvbiAyNDE5MjcpCisrKyBj b250cmliL2xpYmMrKy9pbmNsdWRlL2N3Y2hhcgkod29ya2luZyBjb3B5KQpAQCAtMTUxLDkg KzE1MSwxMyBAQAogdXNpbmcgOjp3Y3N0b2xkOwogI2VuZGlmIC8vIF9NU0NfVkVSCiB1c2lu ZyA6Ondjc3RvbDsKKyNpZmRlZiBfX0xPTkdfTE9OR19TVVBQT1JURUQKIHVzaW5nIDo6d2Nz dG9sbDsKKyNlbmRpZgogdXNpbmcgOjp3Y3N0b3VsOworI2lmZGVmIF9fTE9OR19MT05HX1NV UFBPUlRFRAogdXNpbmcgOjp3Y3N0b3VsbDsKKyNlbmRpZgogdXNpbmcgOjp3Y3NjcHk7CiB1 c2luZyA6Ondjc25jcHk7CiB1c2luZyA6Ondjc2NhdDsK --------------050504010505010207000702-- From owner-freebsd-toolchain@FreeBSD.ORG Fri Nov 23 21:27:57 2012 Return-Path: Delivered-To: toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 49399442 for ; Fri, 23 Nov 2012 21:27:57 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) by mx1.freebsd.org (Postfix) with ESMTP id F2E9B8FC13 for ; Fri, 23 Nov 2012 21:27:56 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:d00c:cf93:2eda:7a7] (unknown [IPv6:2001:7b8:3a7:0:d00c:cf93:2eda:7a7]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 2DC315C37; Fri, 23 Nov 2012 22:27:50 +0100 (CET) Message-ID: <50AFEA5D.2020607@FreeBSD.org> Date: Fri, 23 Nov 2012 22:27:57 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Yamaya Takashi Subject: Re: [patch][libc++]using some undeclared functions with -std=c++98, -std=c++03 or -ansi References: <50AEB0A1.3090803@kbh.biglobe.ne.jp> In-Reply-To: <50AEB0A1.3090803@kbh.biglobe.ne.jp> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: toolchain@freebsd.org X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2012 21:27:57 -0000 On 2012-11-23 00:09, Yamaya Takashi wrote: > With -std=c++98, -std=c++03 or -ansi, __LONG_LONG_SUPPORTED is not defined. > So some functions((lldiv_t, )atoll, strtoll, strtoull, llabs, lldiv, > wcstoll, wcstoull) are undeclared. > But libc++ headers(cstdlib and cwchar) use them. The general idea of your patch is good, but we need to check it with upstream first. For example, __LONG_LONG_SUPPORTED is a FreeBSD specific define, so for the general case the solution might be more complicated. Note there are also other problems when compiling libc++ with -std=c++98 and -std=c++03, such as complaints about namespacing and such. I am not entirely sure libc++ is fully supported yet under those restrictions. :) In any case, I will see if I can come up with a patch which is more suitable for upstream, and move the discussion there. From owner-freebsd-toolchain@FreeBSD.ORG Sat Nov 24 07:18:15 2012 Return-Path: Delivered-To: toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 790CAF20; Sat, 24 Nov 2012 07:18:15 +0000 (UTC) (envelope-from yamayan@kbh.biglobe.ne.jp) Received: from rcpt-expgw.biglobe.ne.jp (rcpt-expgw.biglobe.ne.jp [IPv6:2001:260:401:16::4]) by mx1.freebsd.org (Postfix) with ESMTP id 66F9A8FC08; Sat, 24 Nov 2012 07:18:14 +0000 (UTC) Received: from vc-gw.biglobe.ne.jp by rcpt-expgw.biglobe.ne.jp (shby/5910021009) with SMTP id qAO7ICHK032615; Sat, 24 Nov 2012 16:18:12 +0900 Received: from smtp-gw.biglobe.ne.jp ([172.21.175.156]) by vc-gw.biglobe.ne.jp (kbkr/0716090908) with ESMTP id qAO7IC3K018560; Sat, 24 Nov 2012 16:18:12 +0900 X-Biglobe-Sender: Received: from [192.168.0.100] (KD027083060020.ppp-bb.dion.ne.jp [27.83.60.20]) by smtp-gw.biglobe.ne.jp id QABZAC15AFDC; Sat, 24 Nov 2012 16:18:12 +0900 (JST) Message-ID: <50B074C9.6060402@kbh.biglobe.ne.jp> Date: Sat, 24 Nov 2012 16:18:33 +0900 From: Yamaya Takashi User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Dimitry Andric Subject: Re: [patch][libc++]using some undeclared functions with -std=c++98, -std=c++03 or -ansi References: <50AEB0A1.3090803@kbh.biglobe.ne.jp> <50AFEA5D.2020607@FreeBSD.org> In-Reply-To: <50AFEA5D.2020607@FreeBSD.org> Content-Type: multipart/mixed; boundary="------------070908090902020303000109" Cc: toolchain@freebsd.org X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2012 07:18:15 -0000 This is a multi-part message in MIME format. --------------070908090902020303000109 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 2012/11/24 06:27, Dimitry Andric wrote: > On 2012-11-23 00:09, Yamaya Takashi wrote: >> With -std=c++98, -std=c++03 or -ansi, __LONG_LONG_SUPPORTED is not >> defined. >> So some functions((lldiv_t, )atoll, strtoll, strtoull, llabs, lldiv, >> wcstoll, wcstoull) are undeclared. >> But libc++ headers(cstdlib and cwchar) use them. > > The general idea of your patch is good, but we need to check it with > upstream first. For example, __LONG_LONG_SUPPORTED is a FreeBSD > specific define, so for the general case the solution might be more > complicated. > __LONG_LONG_SUPPORTED is controlled by __STRICT_ANSI__ and __cplusplus in sys/cdefs.h. defined(__LONG_LONG_SUPPORTED) is equal to !defined(__STRICT_ANSI__) || __cplusplus >= 201103L with clang++. > Note there are also other problems when compiling libc++ with -std=c++98 > and -std=c++03, such as complaints about namespacing and such. I am not > entirely sure libc++ is fully supported yet under those restrictions. :) > What are complaints about namespacing? --------------070908090902020303000109 Content-Type: text/plain; charset=UTF-8; name="libcxx.patch.20121124" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="libcxx.patch.20121124" Index: contrib/libc++/include/cstdlib =================================================================== --- contrib/libc++/include/cstdlib (revision 243468) +++ contrib/libc++/include/cstdlib (working copy) @@ -97,18 +97,26 @@ using ::size_t; using ::div_t; using ::ldiv_t; +#if !defined(__STRICT_ANSI__) || __cplusplus >= 201103L using ::lldiv_t; +#endif using ::atof; using ::atoi; using ::atol; +#if !defined(__STRICT_ANSI__) || __cplusplus >= 201103L using ::atoll; +#endif using ::strtod; using ::strtof; using ::strtold; using ::strtol; +#if !defined(__STRICT_ANSI__) || __cplusplus >= 201103L using ::strtoll; +#endif using ::strtoul; +#if !defined(__STRICT_ANSI__) || __cplusplus >= 201103L using ::strtoull; +#endif using ::rand; using ::srand; using ::calloc; @@ -125,10 +133,14 @@ using ::qsort; using ::abs; using ::labs; +#if !defined(__STRICT_ANSI__) || __cplusplus >= 201103L using ::llabs; +#endif using ::div; using ::ldiv; +#if !defined(__STRICT_ANSI__) || __cplusplus >= 201103L using ::lldiv; +#endif using ::mblen; using ::mbtowc; using ::wctomb; @@ -145,10 +157,14 @@ // MSVC already has the correct prototype in #ifdef __cplusplus #if !defined(_MSC_VER) && !defined(__sun__) inline _LIBCPP_INLINE_VISIBILITY long abs( long __x) _NOEXCEPT {return labs(__x);} +#if !defined(__STRICT_ANSI__) || __cplusplus >= 201103L inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT {return llabs(__x);} +#endif inline _LIBCPP_INLINE_VISIBILITY ldiv_t div( long __x, long __y) _NOEXCEPT {return ldiv(__x, __y);} +#if !defined(__STRICT_ANSI__) || __cplusplus >= 201103L inline _LIBCPP_INLINE_VISIBILITY lldiv_t div(long long __x, long long __y) _NOEXCEPT {return lldiv(__x, __y);} +#endif #endif // _MSC_VER _LIBCPP_END_NAMESPACE_STD Index: contrib/libc++/include/cwchar =================================================================== --- contrib/libc++/include/cwchar (revision 243468) +++ contrib/libc++/include/cwchar (working copy) @@ -151,9 +151,13 @@ using ::wcstold; #endif // _MSC_VER using ::wcstol; +#if !defined(__STRICT_ANSI__) || __cplusplus >= 201103L using ::wcstoll; +#endif using ::wcstoul; +#if !defined(__STRICT_ANSI__) || __cplusplus >= 201103L using ::wcstoull; +#endif using ::wcscpy; using ::wcsncpy; using ::wcscat; --------------070908090902020303000109-- From owner-freebsd-toolchain@FreeBSD.ORG Sat Nov 24 11:12:47 2012 Return-Path: Delivered-To: toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ADE26BB5; Sat, 24 Nov 2012 11:12:47 +0000 (UTC) (envelope-from theraven@theravensnest.org) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) by mx1.freebsd.org (Postfix) with ESMTP id 64C928FC14; Sat, 24 Nov 2012 11:12:46 +0000 (UTC) Received: from [192.168.0.2] (cpc39-cmbg15-2-0-cust69.5-4.cable.virginmedia.com [81.101.138.70]) (authenticated bits=0) by theravensnest.org (8.14.5/8.14.5) with ESMTP id qAOAj4qV086317 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Sat, 24 Nov 2012 10:45:05 GMT (envelope-from theraven@theravensnest.org) Subject: Re: [patch][libc++]using some undeclared functions with -std=c++98, -std=c++03 or -ansi Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii From: David Chisnall In-Reply-To: <50AFEA5D.2020607@FreeBSD.org> Date: Sat, 24 Nov 2012 10:45:01 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <76D35059-88C3-49F3-A871-3402A49875CD@theravensnest.org> References: <50AEB0A1.3090803@kbh.biglobe.ne.jp> <50AFEA5D.2020607@FreeBSD.org> To: Dimitry Andric X-Mailer: Apple Mail (2.1278) Cc: toolchain@freebsd.org X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2012 11:12:47 -0000 On 23 Nov 2012, at 21:27, Dimitry Andric wrote: > Note there are also other problems when compiling libc++ with = -std=3Dc++98 > and -std=3Dc++03, such as complaints about namespacing and such. I am = not > entirely sure libc++ is fully supported yet under those restrictions. = :) In theory, the libc++ headers that are part of the C++03 spec (i.e. not = things like ) should work in C++98 / C++03 mode, however the = implementation in libc++ must be compiled in C++11 mode. To upstream this patch, the __LONG_LONG_SUPPORTED flag should be = unconditionally set for non-FreeBSD flags in the __config file in = libc++. This will have no functionality change on other platforms. David=