[newlib-cygwin/main] libc/features.h: Make code match documentation
Corinna Vinschen
corinna@sourceware.org
Wed Nov 19 11:15:18 GMT 2025
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=abce9786a0c6cbfbf2d095461341574ec7097d71
commit abce9786a0c6cbfbf2d095461341574ec7097d71
Author: Simon Barth <simon.barth@gmx.de>
AuthorDate: Sat Nov 15 00:26:25 2025 +0100
Commit: Corinna Vinschen <corinna@vinschen.de>
CommitDate: Wed Nov 19 12:12:23 2025 +0100
libc/features.h: Make code match documentation
The documentation states that _GNU_SOURCE enables "all of the above
plus GNU extensions.". Furthermore the documentation states that
_DEFAULT_SOURCE would enable POSIX-1.2008 with BSD and SVr4 extensions.
The code did different things though:
* For _GNU_SOURCE it only enabled POSIX.1-2008 but it should have been the
highest available one, POSIX.1-2024.
* For _DEFAULT_SOURCE it enabled POSIX.1-2024.
Let's use the highest available POSIX standard possible and fix
documentation where necessary.
Diff:
---
newlib/libc/include/sys/features.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/newlib/libc/include/sys/features.h b/newlib/libc/include/sys/features.h
index 2a5da45ab5a6..f0f5286ac93e 100644
--- a/newlib/libc/include/sys/features.h
+++ b/newlib/libc/include/sys/features.h
@@ -105,7 +105,7 @@ extern "C" {
* _BSD_SOURCE (deprecated by _DEFAULT_SOURCE)
* _SVID_SOURCE (deprecated by _DEFAULT_SOURCE)
* _DEFAULT_SOURCE (or none of the above)
- * POSIX-1.2008 with BSD and SVr4 extensions
+ * POSIX.1-2024 with BSD and SVr4 extensions
*
* _FORTIFY_SOURCE = 1, 2 or 3
* Object Size Checking function wrappers
@@ -132,7 +132,7 @@ extern "C" {
#undef _POSIX_SOURCE
#define _POSIX_SOURCE 1
#undef _POSIX_C_SOURCE
-#define _POSIX_C_SOURCE 200809L
+#define _POSIX_C_SOURCE 202405L
#undef _XOPEN_SOURCE
#define _XOPEN_SOURCE 700
#undef _XOPEN_SOURCE_EXTENDED
More information about the Newlib-cvs
mailing list