Do not use __ptr_t

Message ID e76ddbc9-6f77-6ccd-7953-093c6939c81b@cs.ucla.edu
State New
Headers show

Commit Message

Paul Eggert Aug. 8, 2017, 5:51 p.m.
Joseph Myers wrote:
> Would you like to propose a patch (that deprecates __ptr_t like that

Sure, that's easy enough. Proposed patch attached.

Comments

Joseph Myers Aug. 8, 2017, 6:07 p.m. | #1
On Tue, 8 Aug 2017, Paul Eggert wrote:

> Joseph Myers wrote:
> > Would you like to propose a patch (that deprecates __ptr_t like that
> 
> Sure, that's easy enough. Proposed patch attached.

OK (subject to testing on at least one platform), unless there are any 
objections within the next few days.  (But if distribution rebuilds show 
excessive fallout from this change - much more than you'd generally expect 
from a new GCC or glibc version - we may need to reconsider.)

Patch

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