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][BZ #11157][v2] Rename uses of '__block' in installed header files


Hi All,

As detailed in PR11157, the use of '__block' is known to interfere with
keywords in some environments, such as the Clang -fblocks extension.
Recently a similar issue was raised concerning the use of '__unused'
and a '__glibc' prefix was proposed to create a glibc implementation
namespace for these sorts of issues [1].  This patches takes that approach.

I performed the usual 'make check' testing, verified that issues compiling
applications with glibc headers using 'clang -fblocks' are gone, and ensured
that there are no code generation differences as a result of the change.

Note that this is also on Joseph's glibc/EGLIBC differences list [2].

OK?

[1] https://sourceware.org/ml/libc-alpha/2012-02/msg00047.html
[2] http://lists.debian.org/debian-glibc/2013/11/msg00020.html

2013-11-21  Meador Inge  <meadori@codesourcery.com>

	[BZ #11157]
	* crypt/crypt.h (encrypt): Use __glibc_block instead of __block.
	(encrypt_r): Likewise.
	* malloc/obstack.h (obstack_free): Likewise.
	* posix/unistd.h (encrypt): Likewise.
---
 crypt/crypt.h    | 5 +++--
 malloc/obstack.h | 2 +-
 posix/unistd.h   | 3 ++-
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/crypt/crypt.h b/crypt/crypt.h
index 985720b..e0d37b5 100644
--- a/crypt/crypt.h
+++ b/crypt/crypt.h
@@ -37,7 +37,8 @@ extern void setkey (const char *__key) __THROW __nonnull ((1));
 
 /* Encrypt data in BLOCK in place if EDFLAG is zero; otherwise decrypt
    block in place.  */
-extern void encrypt (char *__block, int __edflag) __THROW __nonnull ((1));
+extern void encrypt (char *__glibc_block, int __edflag)
+     __THROW __nonnull ((1));
 
 #ifdef __USE_GNU
 /* Reentrant versions of the functions above.  The additional argument
@@ -64,7 +65,7 @@ extern void setkey_r (const char *__key,
 		      struct crypt_data * __restrict __data)
      __THROW __nonnull ((1, 2));
 
-extern void encrypt_r (char *__block, int __edflag,
+extern void encrypt_r (char *__glibc_block, int __edflag,
 		       struct crypt_data * __restrict __data)
      __THROW __nonnull ((1, 3));
 #endif
diff --git a/malloc/obstack.h b/malloc/obstack.h
index d2e056b..e786d1f 100644
--- a/malloc/obstack.h
+++ b/malloc/obstack.h
@@ -185,7 +185,7 @@ extern int _obstack_begin_1 (struct obstack *, int, int,
 			     void (*) (void *, void *), void *);
 extern int _obstack_memory_used (struct obstack *);
 
-void obstack_free (struct obstack *__obstack, void *__block);
+void obstack_free (struct obstack *__obstack, void *__glibc_block);
 
 
 /* Error handler called when `obstack_chunk_alloc' failed to allocate
diff --git a/posix/unistd.h b/posix/unistd.h
index 178223d..d4eeaf1 100644
--- a/posix/unistd.h
+++ b/posix/unistd.h
@@ -1144,7 +1144,8 @@ extern char *crypt (const char *__key, const char *__salt)
 
 /* Encrypt data in BLOCK in place if EDFLAG is zero; otherwise decrypt
    block in place.  */
-extern void encrypt (char *__block, int __edflag) __THROW __nonnull ((1));
+extern void encrypt (char *__glibc_block, int __edflag)
+     __THROW __nonnull ((1));
 
 
 /* Swab pairs bytes in the first N bytes of the area pointed to by
-- 
1.8.1.1


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