[19/31] Remove hidden_def and hidden_proto from cvt functions
diff mbox series

Message ID 20191015190529.11559-20-gabriel@inconstante.net.br
State New
Headers show
Series
  • Add IEEE long double <-> string functions for powerpc64le
Related show

Commit Message

Gabriel F. T. Gomes Oct. 15, 2019, 7:05 p.m. UTC
From: "Gabriel F. T. Gomes" <gabrielftg@linux.ibm.com>

Some *cvt functions are not called from within libc, yet they use
hidden_def and hidden_proto.  This patch cleans this up and adds
attribute_hidden to the declarations, for architectures that need it.

Tested for powerpc64le and x86_64.
---
 include/stdlib.h | 16 ++++++++--------
 misc/efgcvt_r.c  |  3 ---
 2 files changed, 8 insertions(+), 11 deletions(-)

Comments

Gabriel F. T. Gomes Oct. 21, 2019, 1:55 a.m. UTC | #1
On Tue, 15 Oct 2019, Gabriel F. T. Gomes wrote:
>
>Some *cvt functions are not called from within libc, yet they use
>hidden_def and hidden_proto.  This patch cleans this up and adds
>attribute_hidden to the declarations, for architectures that need it.

As I mentioned on a reply to Florian, I tested this patchset with
build-many-glibcs.py and I found another error (besides the one that
Florian pointed out).  The error is caused by this patch (on at least
s390x and alpha), but the patch is actually not needed, at all. :/

I'll send v2 without it and adapted for its absence. :)

Patch
diff mbox series

diff --git a/include/stdlib.h b/include/stdlib.h
index 114e12d255..089607dbf9 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -260,12 +260,12 @@  extern char *__fcvt (double __value, int __ndigit, int *__restrict __decpt,
 extern char *__gcvt (double __value, int __ndigit, char *__buf);
 extern int __ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
 		     int *__restrict __sign, char *__restrict __buf,
-		     size_t __len);
-libc_hidden_proto (__ecvt_r)
+		     size_t __len)
+  attribute_hidden;
 extern int __fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
 		     int *__restrict __sign, char *__restrict __buf,
-		     size_t __len);
-libc_hidden_proto (__fcvt_r)
+		     size_t __len)
+  attribute_hidden;
 extern char *__qecvt (long double __value, int __ndigit,
 		      int *__restrict __decpt, int *__restrict __sign);
 extern char *__qfcvt (long double __value, int __ndigit,
@@ -273,12 +273,12 @@  extern char *__qfcvt (long double __value, int __ndigit,
 extern char *__qgcvt (long double __value, int __ndigit, char *__buf);
 extern int __qecvt_r (long double __value, int __ndigit,
 		      int *__restrict __decpt, int *__restrict __sign,
-		      char *__restrict __buf, size_t __len);
-libc_hidden_proto (__qecvt_r)
+		      char *__restrict __buf, size_t __len)
+  attribute_hidden;
 extern int __qfcvt_r (long double __value, int __ndigit,
 		      int *__restrict __decpt, int *__restrict __sign,
-		      char *__restrict __buf, size_t __len);
-libc_hidden_proto (__qfcvt_r)
+		      char *__restrict __buf, size_t __len)
+  attribute_hidden;
 
 # if IS_IN (libc)
 #  undef MB_CUR_MAX
diff --git a/misc/efgcvt_r.c b/misc/efgcvt_r.c
index 981249850c..30d25ff114 100644
--- a/misc/efgcvt_r.c
+++ b/misc/efgcvt_r.c
@@ -240,7 +240,6 @@  __APPEND (FUNC_PREFIX, ecvt_r) (FLOAT_TYPE value, int ndigit, int *decpt,
   cvt_symbol_1 (libc, __APPEND (FUNC_PREFIX, symbol), \
 	      APPEND (FUNC_PREFIX, symbol), GLIBC_2_4)
 #  define cvt_symbol_1(lib, local, symbol, version) \
-    libc_hidden_def (local) \
     versioned_symbol (lib, local, symbol, version)
 # else
 #  define cvt_symbol(symbol) \
@@ -248,14 +247,12 @@  __APPEND (FUNC_PREFIX, ecvt_r) (FLOAT_TYPE value, int ndigit, int *decpt,
 	      APPEND (q, symbol), GLIBC_2_0); \
   weak_alias (__APPEND (FUNC_PREFIX, symbol), APPEND (FUNC_PREFIX, symbol))
 #  define cvt_symbol_1(lib, local, symbol, version) \
-  libc_hidden_def (local) \
   compat_symbol (lib, local, symbol, version)
 # endif
 #else
 # define cvt_symbol(symbol) \
   cvt_symbol_1 (__APPEND (FUNC_PREFIX, symbol), APPEND (FUNC_PREFIX, symbol))
 #  define cvt_symbol_1(local, symbol) \
-  libc_hidden_def (local) \
   weak_alias (local, symbol)
 #endif
 cvt_symbol(fcvt_r);