Re: [scc-dev] [PATCH 1/3] make/posix: fix feature test macros

From: Roberto E. Vargas Caballero <k0ga_at_shike2.net>
Date: Wed, 26 Feb 2025 11:01:52 +0100

Quoth remph <lhr_at_disroot.org>:
> * Feature test macros must be defined to an integer, or features.h will
> error when comparing them with integers

in fact, _POSIX_C_SOURCE has a specific set of values, 1, 2, 199309L,
199506L, ..., depending of the version of the standard that you want
to expose.

> * glibc wants _XOPEN_SOURCE (which also implies _POSIX_C_SOURCE) for some
> stat macros

Can you be more explicit about what macros? I don't think we use
anything that is XSI, so we should not need _XOPEN_SOURCE, but

we do need a correct value of _POSIX_C_SOURCE (I suppose 200112L
should be good enough). In fact, I would do the same that is done
in src/cmd/scc-cc/posix/cc.c:

        #undef _POSIX_C_SOURCE
        #define _POSIX_C_SOURCE 200809L

and keep the same POSIX version in both files.

Regards,

--
To unsubscribe send a mail to scc-dev+unsubscribe_at_simple-cc.org
Received on Wed 26 Feb 2025 - 11:01:52 CET

This archive was generated by hypermail 2.3.0 : Wed 26 Feb 2025 - 11:10:01 CET