[newlib-cygwin/cygwin-3_6-branch] libc/features.h: Make code match documentation

Corinna Vinschen corinna@sourceware.org
Thu Feb 12 20:18:16 GMT 2026


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=69fde5d986e6ddbfeb7b3d13308263510304e9ef

commit 69fde5d986e6ddbfeb7b3d13308263510304e9ef
Author:     Simon Barth <simon.barth@gmx.de>
AuthorDate: Sat Nov 15 00:26:25 2025 +0100
Commit:     Corinna Vinschen <corinna@vinschen.de>
CommitDate: Thu Feb 12 21:15:36 2026 +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.
    
    (cherry picked from commit abce9786a0c6cbfbf2d095461341574ec7097d71)

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 325acdf5f276..24511ec6e253 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