[Bug libstdc++/103626] _GLIBCXX_HOSTED should respect -ffreestanding

arsen at aarsen dot me gcc-bugzilla@gcc.gnu.org
Sun Sep 18 01:40:22 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103626

--- Comment #4 from Arsen Arsenović <arsen at aarsen dot me> ---
(In reply to Jonathan Wakely from comment #3)
> I don't think we need to add the #error to every header. For a start, users
> never include the bits/* headers directly, and if they do, it's their
> problem. So we only need to mark the standard headers as hosted-only. And if
> we add it to <iosfwd>, that already covers a large number of them, because
> they include that.

My thinking behind doing that was that it'd make includes transitively carry a
requirement on hosted, so that if some header is meant to be freestanding, but
depends on a hosted header, that could be detected (and that could probably be
a testcase).


More information about the Gcc-bugs mailing list