[Bug 255290] _POSIX_C_SOURCE=200809 hides static_assert

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Wed Apr 21 14:33:22 UTC 2021


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255290

--- Comment #4 from Tobias Kortkamp <tobik at freebsd.org> ---
> static_assert was added, I believe, in C11 and C++11. As such, it should
> be hidden from the 2008 posix environment.

This was my initial reaction too when I tried to defend FreeBSD's behavior.
But what are you basing this on?

> If POSIX 2008 and/or C99 do not mandate static_assert, it must be hidden for
> them. A general rule is that system headers cannot pollute name spaces of the
> user when directed to do so by things like POSIX_C_SOURCE.

That would be fine if we were asking for C99 but we are asking for
C11 with POSIX 2008 specifically, so should static_assert then not
be unhidden since it is allowed by C11?

> Additional symbols not required or explicitly permitted by IEEE Std 1003.1-2001
> to be in that header shall not be made visible, except when enabled by another
> feature test macro.

Would you interpret -std={c,gnu}11 as "another feature test macro" (or
something that sets some, specifically __STDC_VERSION__=201112)?

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-standards mailing list