public inbox for libc-ports@sourceware.org
 help / color / mirror / Atom feed
* [PATCH ports] Use __unused0 instead of __unused for user visible struct members
@ 2012-01-02  3:19 Guillem Jover
  2012-01-02  6:06 ` Mike Frysinger
  0 siblings, 1 reply; 5+ messages in thread
From: Guillem Jover @ 2012-01-02  3:19 UTC (permalink / raw)
  To: libc-ports

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 ports headers. Separate patches have
been sent to fix the same issue on Linux kernel headers and the main
glibc project.

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-02  Guillem Jover  <guillem@hadrons.org>

	* sysdeps/unix/sysv/linux/alpha/bits/stat.h (struct stat)
	(struct stat64): Rename __unused to __unused0.
	* sysdeps/unix/sysv/linux/alpha/kernel_stat.h
	(struct kernel_stat64, struct glibc21_stat): Likewise.
	* sysdeps/unix/sysv/linux/alpha/xstatconv.c (__xstat_conv):
	Likewise.
	* sysdeps/unix/sysv/linux/generic/bits/stat.h (struct stat)
	(struct stat64): Likewise.
---
 sysdeps/unix/sysv/linux/alpha/bits/stat.h   |    4 ++--
 sysdeps/unix/sysv/linux/alpha/kernel_stat.h |    4 ++--
 sysdeps/unix/sysv/linux/alpha/xstatconv.c   |   14 +++++++-------
 sysdeps/unix/sysv/linux/generic/bits/stat.h |    4 ++--
 4 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/alpha/bits/stat.h b/sysdeps/unix/sysv/linux/alpha/bits/stat.h
index d7241bd..1d23bfc 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/stat.h
@@ -93,7 +93,7 @@ struct stat
     __ST_TIME(a);		/* Time of last access.  */
     __ST_TIME(m);		/* Time of last modification.  */
     __ST_TIME(c);		/* Time of last status change.  */
-    long __unused[3];
+    long __unused0[3];
   };
 
 #ifdef __USE_LARGEFILE64
@@ -114,7 +114,7 @@ struct stat64
     __ST_TIME(a);		/* Time of last access.  */
     __ST_TIME(m);		/* Time of last modification.  */
     __ST_TIME(c);		/* Time of last status change.  */
-    long __unused[3];
+    long __unused0[3];
   };
 #endif
 
diff --git a/sysdeps/unix/sysv/linux/alpha/kernel_stat.h b/sysdeps/unix/sysv/linux/alpha/kernel_stat.h
index a1d012a..fbf6b62 100644
--- a/sysdeps/unix/sysv/linux/alpha/kernel_stat.h
+++ b/sysdeps/unix/sysv/linux/alpha/kernel_stat.h
@@ -40,7 +40,7 @@ struct kernel_stat64
     unsigned long   st_mtimensec;
     unsigned long   st_ctime;
     unsigned long   st_ctimensec;
-    long            __unused[3];
+    long            __unused0[3];
   };
 
 /* Definition of `struct stat' used by glibc 2.0.  */
@@ -82,7 +82,7 @@ struct glibc21_stat
     unsigned int st_flags;
     unsigned int st_gen;
     int __pad3;
-    long __unused[4];
+    long __unused0[4];
   };
 
 #define XSTAT_IS_XSTAT64 1
diff --git a/sysdeps/unix/sysv/linux/alpha/xstatconv.c b/sysdeps/unix/sysv/linux/alpha/xstatconv.c
index 86bb374..9f62b50 100644
--- a/sysdeps/unix/sysv/linux/alpha/xstatconv.c
+++ b/sysdeps/unix/sysv/linux/alpha/xstatconv.c
@@ -82,10 +82,10 @@ __xstat_conv (int vers, struct kernel_stat *kbuf, void *ubuf)
 	buf->st_flags = kbuf->st_flags;
 	buf->st_gen = kbuf->st_gen;
 	buf->__pad3 = 0;
-	buf->__unused[0] = 0;
-	buf->__unused[1] = 0;
-	buf->__unused[2] = 0;
-	buf->__unused[3] = 0;
+	buf->__unused0[0] = 0;
+	buf->__unused0[1] = 0;
+	buf->__unused0[2] = 0;
+	buf->__unused0[3] = 0;
       }
       break;
 
@@ -113,9 +113,9 @@ __xstat_conv (int vers, struct kernel_stat *kbuf, void *ubuf)
 	buf->st_ctime = kbuf->st_ctime;
 	buf->st_ctimensec = 0;
 
-	buf->__unused[0] = 0;
-	buf->__unused[1] = 0;
-	buf->__unused[2] = 0;
+	buf->__unused0[0] = 0;
+	buf->__unused0[1] = 0;
+	buf->__unused0[2] = 0;
       }
       break;
 
diff --git a/sysdeps/unix/sysv/linux/generic/bits/stat.h b/sysdeps/unix/sysv/linux/generic/bits/stat.h
index d3cec6f..490378b 100644
--- a/sysdeps/unix/sysv/linux/generic/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/generic/bits/stat.h
@@ -88,7 +88,7 @@ struct stat
     __time_t st_ctime;			/* Time of last status change.  */
     unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
 #endif
-    int __unused[2];
+    int __unused0[2];
   };
 
 #undef __field64
@@ -126,7 +126,7 @@ struct stat64
     __time_t st_ctime;			/* Time of last status change.  */
     unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
 #endif
-    int __unused[2];
+    int __unused0[2];
   };
 #endif
 
-- 
1.7.7.3

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-01-09  5:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-02  3:19 [PATCH ports] Use __unused0 instead of __unused for user visible struct members Guillem Jover
2012-01-02  6:06 ` Mike Frysinger
2012-01-04  7:12   ` Guillem Jover
2012-01-04 11:57     ` Joseph S. Myers
2012-01-09  5:35       ` Guillem Jover

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).