C++ Logo


Advanced search

Re: [SG10] P2198R0, more feature-test poking from freestanding

From: Ben Craig <ben.craig_at_[hidden]>
Date: Sun, 12 Jul 2020 21:49:18 +0000
I'm not opposed to a DR, but the predecessor to this paper, https://wg21.link/P1641, was seen in Belfast (Nov 2019) in SG10, and LEWGI in Prague (Feb 2020), and there wasn't any pressure from the rooms at the time to rush the issue through. The SG10 meeting even had some prominent LWG members, including Mr. Wakely, who later that day made the previously mentioned change to libstdc++'s freestanding implementation.

A confounding factor in research for this topic is that there are lots of ways to get into a misleading state with today's toolchains, but those states may not be in modes that the implementer considers the conforming modes. The example I link in P2198 has a libstdc++ that was (presumably) built in a hosted mode, but I pass -ffreestanding on the gcc command line. That's unlikely to be a usefully conforming use case. A better test for user impact would involve a standard library built for freestanding, as well as using the compiler flags necessary to target a freestanding platform.
From: SG10 <sg10-bounces_at_[hidden]> on behalf of Ville Voutilainen via SG10 <sg10_at_[hidden]>
Sent: Sunday, July 12, 2020 3:23 PM
To: sg10_at_[hidden] <sg10_at_[hidden]>
Cc: Ville Voutilainen <ville.voutilainen_at_[hidden]>
Subject: [EXTERNAL] Re: [SG10] P2198R0, more feature-test poking from freestanding

On Sun, 12 Jul 2020 at 22:45, Jens Maurer via SG10
<sg10_at_[hidden]> wrote:
> On 12/07/2020 20.05, Ben Craig via SG10 wrote:
> > https://urldefense.com/v3/__https://isocpp.org/files/papers/P2198R0.html__;!!FbZ0ZwI3Qg!4DpOQWKvMAJqoFgyngjbfB7Ce4k2RMQtamNZTQaThtQYn2R22GdyEDbC0jDN$
> >
> > While writing examples for feature-test usage in freestanding, I discovered how much of a pain it is to detect extensions to freestanding. The above paper makes that detection possible and makes policy recommendations for future papers. In order to fix the problem, I ended up bumping the version on _all_ the library feature test macros.
> >
> > Let me know what you think, and then we can figure out if we need an SG10 telecon to discuss this.
> Uh.. no.
> It seems that freestanding implementations that ship a <version> header
> with those feature-test macros present that represent features not
> available on their platform (e.g. std::filesystem) are actively misleading
> and violating the spirit of the feature-test macros.
> If the current wording allows or requires such macros for freestanding,
> the standard is buggy and needs to be DR-fixed.

libstdc++ seems to have made the feature-testing macros in <version>
conditional based on hosted/freestanding
at the end of last year. Ben is apparently trying to come up with a
solution that allows feature-testing feature-testing,
i.e. to cope with the shipping problematic implementations.
SG10 mailing list

Received on 2020-07-12 16:52:38