public inbox for libc-ports@sourceware.org
 help / color / mirror / Atom feed
From: Guillem Jover <guillem@hadrons.org>
To: libc-ports@sources.redhat.com
Subject: [PATCH ports] Use __unused0 instead of __unused for user visible struct members
Date: Mon, 02 Jan 2012 03:19:00 -0000	[thread overview]
Message-ID: <20120102031859.GA11067@gaara.hadrons.org> (raw)

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

             reply	other threads:[~2012-01-02  3:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-02  3:19 Guillem Jover [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120102031859.GA11067@gaara.hadrons.org \
    --to=guillem@hadrons.org \
    --cc=libc-ports@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).