From owner-freebsd-toolchain@freebsd.org Mon Jul 31 19:55:33 2017 Return-Path: Delivered-To: freebsd-toolchain@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A06ADBC428 for ; Mon, 31 Jul 2017 19:55:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 1036766257 for ; Mon, 31 Jul 2017 19:55:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: by mailman.ysv.freebsd.org (Postfix) id 0C831DBC427; Mon, 31 Jul 2017 19:55:33 +0000 (UTC) Delivered-To: toolchain@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C070DBC426 for ; Mon, 31 Jul 2017 19:55:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:470:7a58:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9CB6266256; Mon, 31 Jul 2017 19:55:32 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:470:7a58::8145:1768:6be6:c3c7] (unknown [IPv6:2001:470:7a58:0:8145:1768:6be6:c3c7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 8ABB12D48D; Mon, 31 Jul 2017 21:55:29 +0200 (CEST) From: Dimitry Andric Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_E246A37B-9E06-48A3-B1CE-2995E96A6D26"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: [package - head-amd64-default][games/simutrans] Failed for simutrans-120.2.2 in build Date: Mon, 31 Jul 2017 21:55:20 +0200 In-Reply-To: <20170729015914.184c2660@kalimero.tijl.coosemans.org> Cc: toolchain@FreeBSD.org To: Tijl Coosemans References: <201707272142.v6RLg1G4099900@beefy12.nyi.freebsd.org> <20170728135510.2c6de57f@kalimero.tijl.coosemans.org> <20170729015914.184c2660@kalimero.tijl.coosemans.org> X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jul 2017 19:55:33 -0000 --Apple-Mail=_E246A37B-9E06-48A3-B1CE-2995E96A6D26 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 29 Jul 2017, at 01:59, Tijl Coosemans wrote: >=20 > On Fri, 28 Jul 2017 19:54:04 +0200 Dimitry Andric = wrote: >> On 28 Jul 2017, at 13:55, Tijl Coosemans wrote: >>>=20 >>> On Thu, 27 Jul 2017 21:42:01 +0000 pkg-fallout@FreeBSD.org wrote: >> ... >>>> In file included from squirrel/squirrel/sqvm.cc:5: >>>> In file included from /usr/include/c++/v1/math.h:310: >>>> /usr/include/c++/v1/limits:149:85: error: expected expression >>>> _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() = _NOEXCEPT {return type();} >>>> = ^ >>>> squirrel/squirrel/sqobject.h:131:24: note: expanded from macro = 'type' >>>> #define type(obj) ((obj)._type) >>>> ^ >>>=20 >>> Simutrans code defines 'type' as a macro. Shouldn't libc++ headers = use >>> _type or __type or something? >>=20 >> No, the member name 'type' is used in many classes in the C++ = standard >> library, for example all the traits in . Programs = should >> not attempt to redefine this, at least not as a macro. >>=20 >> Note that this also doesn't work with libstdc++, e.g.: >>=20 >> $ cat boom.cpp >> #define type "nope, this will not work" >> #include >>=20 >> and then: >>=20 >> $ g++ -c boom.cpp >> boom.cpp:1:14: error: expected unqualified-id before string constant >> #define type "nope, this will not work" >> ^ >> boom.cpp:1:14: error: expected class-name before string constant >> #define type "nope, this will not work" >> ^ >> boom.cpp:1:14: error: expected '{' before string constant >> boom.cpp:1:14: error: expected class-name before string constant >> #define type "nope, this will not work" >> ^ >> boom.cpp:1:14: error: expected '{' before string constant >> boom.cpp:1:14: error: expected class-name before string constant >> #define type "nope, this will not work" >> ^ >> boom.cpp:1:14: error: expected '{' before string constant >> boom.cpp:1:14: error: expected class-name before string constant >> #define type "nope, this will not work" >> ^ >> boom.cpp:1:14: error: expected '{' before string constant >> boom.cpp:1:14: error: expected unqualified-id before string constant >> #define type "nope, this will not work" >> ^ >> In file included from boom.cpp:3:0: >> /usr/local/lib/gcc6/include/c++/type_traits:212:60: error: template = argument 1 is invalid >> : public __is_void_helper::type>::type >> ^ >> /usr/local/lib/gcc6/include/c++/type_traits:212:61: error: expected = '{' before '::' token >> : public __is_void_helper::type>::type >> ^~ >> [...and lots more errors like this...] >=20 > The code does not include or any of that C++11 stuff. = It > includes . This works with libstdc++ because it doesn't have > , but it would also work when was included, because > libstdc++ uses __type everywhere (and __enable_if and __is_arithmetic, > etc. where libc++ headers use enable_if and is_arithmetic). The > libstdc++ way makes more sense. You cannot expect C++98 code to know > about reserved identifiers in C++11 or C++11 code to know about = reserved > identifiers in later standards. The usage of "type" as a name has been in libc++ since it was first imported upstream about 7 years ago, and the failure you showed is the first instance of such a name clash I have ever heard of. Therefore, I don't think it is too much trouble to change one older program to use a slightly different define. -Dimitry --Apple-Mail=_E246A37B-9E06-48A3-B1CE-2995E96A6D26 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.1 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCWX+LKAAKCRCwXqMKLiCW ozWxAJ9LouTnQs4p1zxIktKYmaD6dC77rQCgo/QfsZgDRkRNkj+Zs8C2ruWvyJc= =+k5K -----END PGP SIGNATURE----- --Apple-Mail=_E246A37B-9E06-48A3-B1CE-2995E96A6D26--