From owner-freebsd-current@freebsd.org Thu Jun 29 17:16:34 2017 Return-Path: Delivered-To: freebsd-current@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 A08F2DA1779 for ; Thu, 29 Jun 2017 17:16:34 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-15.reflexion.net [208.70.210.15]) (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 49CEE67268 for ; Thu, 29 Jun 2017 17:16:33 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 21625 invoked from network); 29 Jun 2017 17:20:45 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 29 Jun 2017 17:20:45 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v8.40.1) with SMTP; Thu, 29 Jun 2017 13:16:31 -0400 (EDT) Received: (qmail 5689 invoked from network); 29 Jun 2017 17:16:31 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 29 Jun 2017 17:16:31 -0000 Received: from [192.168.1.114] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id C3333EC7E56; Thu, 29 Jun 2017 10:16:30 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: head -r320458 (e.g.) amd64 -> powerpc (32-bit) cross-buildworld fails for time libc++ static_asserts and overflow/underflow of long long (system clang/clang++ 4 based build) From: Mark Millard In-Reply-To: <20170629125407.GM1935@kib.kiev.ua> Date: Thu, 29 Jun 2017 10:16:30 -0700 Cc: Dimitry Andric , Justin Hibbits , FreeBSD Toolchain , FreeBSD Current Content-Transfer-Encoding: quoted-printable Message-Id: <22F5CFA1-E6A9-4C41-BD43-967105B44C49@dsl-only.net> References: <5B12D9A6-C9A2-4B0D-B32D-D04D7DB1E3BC@dsl-only.net> <55A1694D-BC40-49AE-BEF7-CEE502126E96@FreeBSD.org> <20170629125407.GM1935@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Thu, 29 Jun 2017 17:16:34 -0000 On 2017-Jun-29, at 5:54 AM, Konstantin Belousov = wrote: >=20 > On Thu, Jun 29, 2017 at 12:47:10PM +0200, Dimitry Andric wrote: >> One nasty problem with this is that it is not possible to figure out = at >> compile time what the size of time_t is. You always need some sort = of >> configure-time test, and an external define. >=20 > It is arguably possible, with constexpr. I took Dimitry's wording as probably referring to testing the size in the C/C++ preprocessor like the original code tests for __LP64__ being defined vs. not to control what it does: extending that to involve more preprocessor tests to pick from more code blocks. (But it is a guess given his wording.) I also took him to be excluding C++17's if-constexpr (or that the limitations in where how it can be used would prevent his intent) --and excluding the types of meta-programming/Substitution-Failure-Is-Not-An-Error usage that if-constexpr can simplify: too much rework of parts of libc++. Net result: extending the Makefile's "if" that he referenced with a powerpc-family test removes something in more contexts than have the problem. I think that he was wishing for a simple way to avoid that loss but still prevent the problem cases. =3D=3D=3D Mark Millard markmi at dsl-only.net