_ISOCxx_SOURCE
Alejandro Colomar
alx@kernel.org
Tue Jun 16 22:09:37 GMT 2026
Hi Joseph,
On 2026-06-16T21:52:57+0000, Joseph Myers wrote:
> On Tue, 16 Jun 2026, Alejandro Colomar via Gcc wrote:
>
> > If one uses a modern GCC with an old glibc (which doesn't know C23),
> > then, using -std=c23 will be problematic: the compiler will enable C23
> > language mode, but the library will entirely and silently ignore
> > _ISOC23_SOURCE, because it doesn't know about it, thus falling back to
> > C89 mode (I guess), and thus will for example enable things like
> > gets(3).
>
> Since the relevant checks in features.h are based on __STDC_VERSION__ >
> something or __STDC_VERSION__ >= something,
Ahh, yup, it has || for either _ISOCxx_SOURCE or __STDC_VERSION__. That
makes sense.
> it will fall back to the most
> recent C standard version known by that glibc version, which is probably
> what you want.
Hmmm, it is. Then it's all fine. Thanks!
Cheers,
Alex
--
<https://www.alejandro-colomar.es>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20260617/98007e77/attachment.sig>
More information about the Libc-alpha
mailing list