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]

Re: Do not use __ptr_t


Joseph Myers wrote:
Would you like to propose a patch (that deprecates __ptr_t like that

Sure, that's easy enough. Proposed patch attached.
>From b9c1e6917d284b578bcce7b3dc42b4e258b004c2 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Tue, 8 Aug 2017 10:50:16 -0700
Subject: [PATCH] Deprecate __ptr_t

* NEWS: Mention this.
* misc/sys/cdefs.h (__ptr_t): Mark it as deprecated.
---
 ChangeLog        | 6 ++++++
 NEWS             | 2 +-
 misc/sys/cdefs.h | 2 +-
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 12d0a7d23e..76716e2d91 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-08-08  Paul Eggert  <eggert@cs.ucla.edu>
+
+	Deprecate __ptr_t
+	* NEWS: Mention this.
+	* misc/sys/cdefs.h (__ptr_t): Mark it as deprecated.
+
 2017-08-08  Joseph Myers  <joseph@codesourcery.com>
 
 	* malloc/mcheck.c (old_free_hook): Use void * instead of __ptr_t.
diff --git a/NEWS b/NEWS
index 4b7e69a1db..68520e9a46 100644
--- a/NEWS
+++ b/NEWS
@@ -13,7 +13,7 @@ Major new features:
 
 Deprecated and removed features, and other changes affecting compatibility:
 
-  [Add deprecations, removals and changes affecting compatibility here]
+* The __ptr_t macro is deprecated.  Programs should use 'void *' instead.
 
 Changes to build and runtime requirements:
 
diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h
index b3e7f3be96..034e75267d 100644
--- a/misc/sys/cdefs.h
+++ b/misc/sys/cdefs.h
@@ -101,7 +101,7 @@
 #define __STRING(x)	#x
 
 /* This is not a typedef so `const __ptr_t' does the right thing.  */
-#define __ptr_t void *
+#define __ptr_t void * __glibc_macro_warning ("__ptr_t is deprecated")
 
 
 /* C++ needs to know that types and declarations are C, not C++.  */
-- 
2.13.3


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