[PATCH] __unused -> __glibc_reserved in public headers

Jakub Jelinek jakub@redhat.com
Mon Feb 16 09:57:18 GMT 2026


Hi!

Rename __unused fields to __glibc_reserved.
__unused is often defined to __attribute__((unused)) in BSD
sources and furthermore libstdc++ testsuite uses it as a macro
to verify libstdc++ headers don't use __unused identifiers.
In ~2012 glibc headers have been cleaned up, but some new
uses of __unused have reappeared (s390 fenv.h already many
years ago, the rest last November).

diff --git a/sysdeps/powerpc/nptl/bits/struct_mutex.h b/sysdeps/powerpc/nptl/bits/struct_mutex.h
index 1472af21f7..ebf2d50922 100644
--- a/sysdeps/powerpc/nptl/bits/struct_mutex.h
+++ b/sysdeps/powerpc/nptl/bits/struct_mutex.h
@@ -32,7 +32,7 @@ struct __pthread_mutex_s
   int __kind;
 #if __WORDSIZE == 64
   short __spins;
-  short __unused;
+  short __glibc_reserved;
   __pthread_list_t __list;
 # define __PTHREAD_MUTEX_HAVE_PREV      1
 #else
diff --git a/sysdeps/s390/nptl/bits/struct_mutex.h b/sysdeps/s390/nptl/bits/struct_mutex.h
index d069b485d1..571265267c 100644
--- a/sysdeps/s390/nptl/bits/struct_mutex.h
+++ b/sysdeps/s390/nptl/bits/struct_mutex.h
@@ -32,7 +32,7 @@ struct __pthread_mutex_s
   int __kind;
 #if __WORDSIZE == 64
   short __spins;
-  short __unused;
+  short __glibc_reserved;
   __pthread_list_t __list;
 # define __PTHREAD_MUTEX_HAVE_PREV      1
 #else
diff --git a/sysdeps/x86/nptl/bits/struct_mutex.h b/sysdeps/x86/nptl/bits/struct_mutex.h
index 9c19dff660..13c9894ad4 100644
--- a/sysdeps/x86/nptl/bits/struct_mutex.h
+++ b/sysdeps/x86/nptl/bits/struct_mutex.h
@@ -32,7 +32,7 @@ struct __pthread_mutex_s
   int __kind;
 #ifdef __x86_64__
   short __spins;
-  short __unused;
+  short __glibc_reserved;
   __pthread_list_t __list;
 # define __PTHREAD_MUTEX_HAVE_PREV      1
 #else
diff --git a/sysdeps/s390/fpu/bits/fenv.h b/sysdeps/s390/fpu/bits/fenv.h
index b9e844e393..33e88fbe9d 100644
--- a/sysdeps/s390/fpu/bits/fenv.h
+++ b/sysdeps/s390/fpu/bits/fenv.h
@@ -76,10 +76,10 @@ typedef unsigned int fexcept_t; /* size of fpc */
 typedef struct
 {
   fexcept_t __fpc;
-  void *__unused;
-  /* The field __unused (formerly __ieee_instruction_pointer) is a relict from
-     commit "Remove PTRACE_PEEKUSER" (87b9b50f0d4b92248905e95a06a13c513dc45e59)
-     and isn't used anymore.  */
+  void *__glibc_reserved;
+  /* The field __glibc_reserved (formerly __ieee_instruction_pointer) is a
+     relict from commit "Remove PTRACE_PEEKUSER"
+     (87b9b50f0d4b92248905e95a06a13c513dc45e59) and isn't used anymore.  */
 } fenv_t;
 
 /* If the default argument is used we use this value.  */

	Jakub



More information about the Libc-alpha mailing list