-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_POSIX_C_SOURCE=1 is invalid #3420
Comments
The expected value for Mbed TLS is used on many embedded platforms that implement a subset of POSIX. So for us, portability is not just what's in POSIX. But it does include POSIX, so I think we should indeed use LTS branches use C89 (plus a few extensions) so we should probably leave them alone. We don't have Solaris or NetBSD on our CI, so a confirmation of what does and doesn't work would be welcome. Ideally with a known-good patch (that isn't at risk of breaking platforms that pretend to be POSIX but only implement a subset). Though looking at why we're setting |
Fixes Mbed-TLS#3420 Signed-off-by: Nia Alarie <[email protected]>
Fixes Mbed-TLS#3420 Signed-off-by: nia <[email protected]>
So it sounds like there's a possible enhancement task here to remove the dependency on |
Strict platforms cannot be expected to accept C99 code as valid when earlier standards versions are selected. This helps the programs build on Solaris-like platforms (e.g. illumos). Fixes Mbed-TLS#3420 Signed-off-by: nia <[email protected]>
Currently several programs set _POSIX_C_SOURCE to 1, e.g. aescrypt2. Going by some build errors I've seen, I think the description of "Harmless on other platforms." is incorrect.
The expected format for
_POSIX_C_SOURCE
is a date corresponding to a revision of the POSIX standard. A baseline for a library which requires C99 should be200112L
. Some strict platforms, e.g. Solaris, will refuse to compile as C99 if the standard is set to anything earlier.See also #2310 - sockaddr_storage requires at least
_XOPEN_SOURCE
of500
.Suggested fix: Set
_POSIX_C_SOURCE
to200112L
instead of1
.The text was updated successfully, but these errors were encountered: