This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Use __unused0 instead of __unused for user visible structmembers


On BSD systems __unused has traditionally been defined to mean the
equivalent of gcc's __attribute__((__unused__)). The problem comes when
defining such macro while trying to build unmodified source code with
BSD origins on systems with glibc headers. A separate patch has been
sent to fix the same issue on Linux kernel headers.

This patch renames the user visible struct members from __unused to
__unused0 to not cause compilation failures due to that macro, which
should not be a problem as those members are supposed to be private
anyway.

2012-01-01  Guillem Jover  <guillem@hadrons.org>

	* resolv/netdb.h (struct gaicb): Rename __unused to __unused0.
	* rt/aio.h (struct aiocb, struct aiocb64): Likewise.
	* sysdeps/gnu/bits/utmp.h (struct utmp): Likewise.
	* sysdeps/gnu/bits/utmpx.h (struct utmpx): Likewise.
	* sysdeps/gnu/netinet/ip_icmp.h (struct icmphdr): Likewise.
	* sysdeps/unix/sysv/linux/ia64/bits/stat.h (struct stat)
	(struct stat64): Likewise.
	* sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h (mcontext_t):
	Likewise.
	* sysdeps/unix/sysv/linux/s390/bits/stat.h (struct stat)
	(struct stat64): Likewise.
	* sysdeps/unix/sysv/linux/s390/bits/utmp.h (struct utmp): Likewise.
	* sysdeps/unix/sysv/linux/s390/bits/utmpx.h (struct utmpx): Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/utmp32.h (struct utmp32):
	Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/utmpx32.h (struct utmpx32):
	Likewise.
	* sysdeps/unix/sysv/linux/sparc/bits/fcntl.h (struct flock)
	(struct flock64): Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h
	(struct kernel_stat64): Likewise.
	* sysdeps/unix/sysv/linux/sparc/sys/procfs.h (elf_fpregset_t)
	(elf_fpregset_t32): Likewise.
	* sysdeps/unix/sysv/linux/x86_64/bits/stat.h (struct stat)
	(struct stat64): Likewise.
---
 resolv/netdb.h                                     |    2 +-
 rt/aio.h                                           |    4 ++--
 sysdeps/gnu/bits/utmp.h                            |    2 +-
 sysdeps/gnu/bits/utmpx.h                           |    2 +-
 sysdeps/gnu/netinet/ip_icmp.h                      |    2 +-
 sysdeps/unix/sysv/linux/ia64/bits/stat.h           |    4 ++--
 sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h     |    2 +-
 sysdeps/unix/sysv/linux/s390/bits/stat.h           |    4 ++--
 sysdeps/unix/sysv/linux/s390/bits/utmp.h           |    2 +-
 sysdeps/unix/sysv/linux/s390/bits/utmpx.h          |    2 +-
 sysdeps/unix/sysv/linux/s390/s390-32/utmp32.h      |    2 +-
 sysdeps/unix/sysv/linux/s390/s390-32/utmpx32.h     |    2 +-
 sysdeps/unix/sysv/linux/sparc/bits/fcntl.h         |    4 ++--
 .../unix/sysv/linux/sparc/sparc64/kernel_stat.h    |    2 +-
 sysdeps/unix/sysv/linux/sparc/sys/procfs.h         |    4 ++--
 sysdeps/unix/sysv/linux/x86_64/bits/stat.h         |    4 ++--
 16 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/resolv/netdb.h b/resolv/netdb.h
index 6b76a25..bdd3b30 100644
--- a/resolv/netdb.h
+++ b/resolv/netdb.h
@@ -588,7 +588,7 @@ struct gaicb
   struct addrinfo *ar_result;	/* Pointer to result.  */
   /* The following are internal elements.  */
   int __return;
-  int __unused[5];
+  int __unused0[5];
 };
 
 /* Lookup mode.  */
diff --git a/rt/aio.h b/rt/aio.h
index 7cfd0c1..25db98d 100644
--- a/rt/aio.h
+++ b/rt/aio.h
@@ -54,7 +54,7 @@ struct aiocb
 #else
   __off64_t aio_offset;		/* File offset.  */
 #endif
-  char __unused[32];
+  char __unused0[32];
 };
 
 /* The same for the 64bit offsets.  Please note that the members aio_fildes
@@ -77,7 +77,7 @@ struct aiocb64
   __ssize_t __return_value;
 
   __off64_t aio_offset;		/* File offset.  */
-  char __unused[32];
+  char __unused0[32];
 };
 #endif
 
diff --git a/sysdeps/gnu/bits/utmp.h b/sysdeps/gnu/bits/utmp.h
index e855ad7..23adc8f 100644
--- a/sysdeps/gnu/bits/utmp.h
+++ b/sysdeps/gnu/bits/utmp.h
@@ -83,7 +83,7 @@ struct utmp
 #endif
 
   int32_t ut_addr_v6[4];	/* Internet address of remote host.  */
-  char __unused[20];		/* Reserved for future use.  */
+  char __unused0[20];		/* Reserved for future use.  */
 };
 
 /* Backwards compatibility hacks.  */
diff --git a/sysdeps/gnu/bits/utmpx.h b/sysdeps/gnu/bits/utmpx.h
index c84cda6..140600c 100644
--- a/sysdeps/gnu/bits/utmpx.h
+++ b/sysdeps/gnu/bits/utmpx.h
@@ -79,7 +79,7 @@ struct utmpx
   struct timeval ut_tv;		/* Time entry was made.  */
 #endif
   __int32_t ut_addr_v6[4];	/* Internet address of remote host.  */
-  char __unused[20];		/* Reserved for future use.  */
+  char __unused0[20];		/* Reserved for future use.  */
 };
 
 
diff --git a/sysdeps/gnu/netinet/ip_icmp.h b/sysdeps/gnu/netinet/ip_icmp.h
index 2fc8e9c..af3b5bf 100644
--- a/sysdeps/gnu/netinet/ip_icmp.h
+++ b/sysdeps/gnu/netinet/ip_icmp.h
@@ -39,7 +39,7 @@ struct icmphdr
     u_int32_t	gateway;	/* gateway address */
     struct
     {
-      u_int16_t	__unused;
+      u_int16_t	__unused0;
       u_int16_t	mtu;
     } frag;			/* path mtu discovery */
   } un;
diff --git a/sysdeps/unix/sysv/linux/ia64/bits/stat.h b/sysdeps/unix/sysv/linux/ia64/bits/stat.h
index 86acd27..98bd870 100644
--- a/sysdeps/unix/sysv/linux/ia64/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/ia64/bits/stat.h
@@ -65,7 +65,7 @@ struct stat
 #endif
     __blksize_t st_blksize;	/* Optimal block size for I/O.  */
     __blkcnt_t st_blocks;	/* Nr. 512-byte blocks allocated.  */
-    long int __unused[3];
+    long int __unused0[3];
   };
 
 #ifdef __USE_LARGEFILE64
@@ -104,7 +104,7 @@ struct stat64
 #endif
     __blksize_t st_blksize;	/* Optimal block size for I/O.  */
     __blkcnt64_t st_blocks;	/* Nr. 512-byte blocks allocated.  */
-    long int __unused[3];
+    long int __unused0[3];
   };
 #endif
 
diff --git a/sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h b/sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h
index 9eb50aa..d73b0ff 100644
--- a/sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h
@@ -98,7 +98,7 @@ typedef struct _libc_vrstate
 } vrregset_t  __attribute__((__aligned__(16)));
 
 typedef struct {
-	unsigned long	__unused[4];
+	unsigned long	__unused0[4];
 	int		signal;
 	int		__pad0;
 	unsigned long	handler;
diff --git a/sysdeps/unix/sysv/linux/s390/bits/stat.h b/sysdeps/unix/sysv/linux/s390/bits/stat.h
index 9d62ad2..e9a2d06 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/stat.h
@@ -82,7 +82,7 @@ struct stat
 #endif
     __blksize_t st_blksize;	/* Optimal block size for I/O.	*/
     __blkcnt_t st_blocks;	/* Nr. 512-byte blocks allocated.  */
-    long int __unused[3];
+    long int __unused0[3];
   };
 #else
 struct stat
@@ -179,7 +179,7 @@ struct stat64
 #  endif
     __blksize_t st_blksize;	/* Optimal block size for I/O.	*/
     __blkcnt64_t st_blocks;	/* Nr. 512-byte blocks allocated.  */
-    long int __unused[3];
+    long int __unused0[3];
   };
 # else
 struct stat64
diff --git a/sysdeps/unix/sysv/linux/s390/bits/utmp.h b/sysdeps/unix/sysv/linux/s390/bits/utmp.h
index acb82b0..e98ea2f 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/utmp.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/utmp.h
@@ -83,7 +83,7 @@ struct utmp
 #endif
 
   int32_t ut_addr_v6[4];	/* Internet address of remote host.  */
-  char __unused[20];		/* Reserved for future use.  */
+  char __unused0[20];		/* Reserved for future use.  */
 };
 
 /* Backwards compatibility hacks.  */
diff --git a/sysdeps/unix/sysv/linux/s390/bits/utmpx.h b/sysdeps/unix/sysv/linux/s390/bits/utmpx.h
index 718e290..24a7302 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/utmpx.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/utmpx.h
@@ -80,7 +80,7 @@ struct utmpx
   struct timeval ut_tv;		/* Time entry was made.  */
 #endif
   __int32_t ut_addr_v6[4];	/* Internet address of remote host.  */
-  char __unused[20];		/* Reserved for future use.  */
+  char __unused0[20];		/* Reserved for future use.  */
 };
 
 
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/utmp32.h b/sysdeps/unix/sysv/linux/s390/s390-32/utmp32.h
index 335bc7f..9d0ffc9 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/utmp32.h
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/utmp32.h
@@ -46,7 +46,7 @@ struct utmp32
   } ut_tv;			/* Time entry was made.  */
 
   int32_t ut_addr_v6[4];	/* Internet address of remote host.  */
-  char __unused[20];		/* Reserved for future use.  */
+  char __unused0[20];		/* Reserved for future use.  */
 };
 
 
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/utmpx32.h b/sysdeps/unix/sysv/linux/s390/s390-32/utmpx32.h
index dedc6c6..6c0742c 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/utmpx32.h
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/utmpx32.h
@@ -46,7 +46,7 @@ struct utmpx32
   } ut_tv;			/* Time entry was made.  */
 
   __int32_t ut_addr_v6[4];	/* Internet address of remote host.  */
-  char __unused[20];		/* Reserved for future use.  */
+  char __unused0[20];		/* Reserved for future use.  */
 };
 
 /* The internal interface needed by the compat wrapper functions.  */
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h b/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
index 1271a12..550c121 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
@@ -171,7 +171,7 @@ struct flock
     __off64_t l_len;	/* Size of the locked area; zero means until EOF.  */
 #endif
     __pid_t l_pid;	/* Process holding the lock.  */
-    short int __unused;
+    short int __unused0;
   };
 
 #ifdef __USE_LARGEFILE64
@@ -182,7 +182,7 @@ struct flock64
     __off64_t l_start;	/* Offset where the lock begins.  */
     __off64_t l_len;	/* Size of the locked area; zero means until EOF.  */
     __pid_t l_pid;	/* Process holding the lock.  */
-    short int __unused;
+    short int __unused0;
   };
 #endif
 
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h b/sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h
index a4e411d..7af6f59 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h
@@ -41,7 +41,7 @@ struct kernel_stat64
     unsigned long int st_mtime_nsec;
     unsigned long int st_ctime_sec;
     unsigned long int st_ctime_nsec;
-    long int __unused[3];
+    long int __unused0[3];
   };
 
 #define XSTAT_IS_XSTAT64 1
diff --git a/sysdeps/unix/sysv/linux/sparc/sys/procfs.h b/sysdeps/unix/sysv/linux/sparc/sys/procfs.h
index 2827b1e..11f620c 100644
--- a/sysdeps/unix/sysv/linux/sparc/sys/procfs.h
+++ b/sysdeps/unix/sysv/linux/sparc/sys/procfs.h
@@ -56,7 +56,7 @@ typedef struct
 	unsigned long	pr_regs[32];
 	double		pr_dregs[16];
       }			pr_fr;
-    unsigned long	__unused;
+    unsigned long	__unused0;
     unsigned long	pr_fsr;
     unsigned char	pr_qcnt;
     unsigned char	pr_q_entrysize;
@@ -151,7 +151,7 @@ typedef struct
 	unsigned int	pr_regs[32];
 	double		pr_dregs[16];
       }			pr_fr;
-    unsigned int	__unused;
+    unsigned int	__unused0;
     unsigned int	pr_fsr;
     unsigned char	pr_qcnt;
     unsigned char	pr_q_entrysize;
diff --git a/sysdeps/unix/sysv/linux/x86_64/bits/stat.h b/sysdeps/unix/sysv/linux/x86_64/bits/stat.h
index c7e4e1f..2c9551c 100644
--- a/sysdeps/unix/sysv/linux/x86_64/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/x86_64/bits/stat.h
@@ -103,7 +103,7 @@ struct stat
     unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
 #endif
 #if __WORDSIZE == 64
-    long int __unused[3];
+    long int __unused0[3];
 #else
 # ifndef __USE_FILE_OFFSET64
     unsigned long int __unused4;
@@ -164,7 +164,7 @@ struct stat64
     unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
 # endif
 # if __WORDSIZE == 64
-    long int __unused[3];
+    long int __unused0[3];
 # else
     __ino64_t st_ino;			/* File serial number.		*/
 # endif
-- 
1.7.7.3


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]