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 <markmi_at_dsl-only.net>
Date: Thu, 29 Jun 2017 10:16:30 -0700
On 2017-Jun-29, at 5:54 AM, Konstantin Belousov <kostikbel at gmail.com> wrote:
> 
> 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.
> 
> 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.

===
Mark Millard
markmi at dsl-only.net
Received on Thu Jun 29 2017 - 15:16:34 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:12 UTC