public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* Remove strtoimax, strtoumax, wcstoimax, wcstoumax inlines
@ 2020-12-08 18:59 Joseph Myers
  2020-12-09 20:25 ` Adhemerval Zanella
  0 siblings, 1 reply; 2+ messages in thread
From: Joseph Myers @ 2020-12-08 18:59 UTC (permalink / raw)
  To: libc-alpha

inttypes.h has inline implementations of the strtoimax, strtoumax,
wcstoimax and wcstoumax functions, despite the corresponding stdlib.h
and wchar.h inlines having been removed in 2007 (commit
9b2e9577b228350b15d88303b00097dd58e8d29b).

Remove those inlines, thereby eliminating all references to the
corresponding __*_internal functions from installed headers (so they
could be made into compat symbols in future if desired).

Tested for x86_64 and x86.

diff --git a/stdlib/inttypes.h b/stdlib/inttypes.h
index 611a8b56c3..bcc56f6af6 100644
--- a/stdlib/inttypes.h
+++ b/stdlib/inttypes.h
@@ -311,124 +311,6 @@ extern uintmax_t wcstoumax (const __gwchar_t *__restrict __nptr,
 			    __gwchar_t ** __restrict __endptr, int __base)
      __THROW;
 
-#ifdef __USE_EXTERN_INLINES
-
-# if __WORDSIZE == 64
-
-extern long int __strtol_internal (const char *__restrict __nptr,
-				   char **__restrict __endptr,
-				   int __base, int __group)
-  __THROW __nonnull ((1)) __wur;
-/* Like `strtol' but convert to `intmax_t'.  */
-__extern_inline intmax_t
-__NTH (strtoimax (const char *__restrict __nptr, char **__restrict __endptr,
-		  int __base))
-{
-  return __strtol_internal (__nptr, __endptr, __base, 0);
-}
-
-extern unsigned long int __strtoul_internal (const char *__restrict __nptr,
-					     char ** __restrict __endptr,
-					     int __base, int __group)
-  __THROW __nonnull ((1)) __wur;
-/* Like `strtoul' but convert to `uintmax_t'.  */
-__extern_inline uintmax_t
-__NTH (strtoumax (const char *__restrict __nptr, char **__restrict __endptr,
-		  int __base))
-{
-  return __strtoul_internal (__nptr, __endptr, __base, 0);
-}
-
-extern long int __wcstol_internal (const __gwchar_t * __restrict __nptr,
-				   __gwchar_t **__restrict __endptr,
-				   int __base, int __group)
-  __THROW __nonnull ((1)) __wur;
-/* Like `wcstol' but convert to `intmax_t'.  */
-__extern_inline intmax_t
-__NTH (wcstoimax (const __gwchar_t *__restrict __nptr,
-		  __gwchar_t **__restrict __endptr, int __base))
-{
-  return __wcstol_internal (__nptr, __endptr, __base, 0);
-}
-
-extern unsigned long int __wcstoul_internal (const __gwchar_t *
-					     __restrict __nptr,
-					     __gwchar_t **
-					     __restrict __endptr,
-					     int __base, int __group)
-  __THROW __nonnull ((1)) __wur;
-/* Like `wcstoul' but convert to `uintmax_t'.  */
-__extern_inline uintmax_t
-__NTH (wcstoumax (const __gwchar_t *__restrict __nptr,
-		  __gwchar_t **__restrict __endptr, int __base))
-{
-  return __wcstoul_internal (__nptr, __endptr, __base, 0);
-}
-
-# else /* __WORDSIZE == 32 */
-
-__extension__
-extern long long int __strtoll_internal (const char *__restrict __nptr,
-					 char **__restrict __endptr,
-					 int __base, int __group)
-  __THROW __nonnull ((1)) __wur;
-/* Like `strtol' but convert to `intmax_t'.  */
-__extern_inline intmax_t
-__NTH (strtoimax (const char *__restrict __nptr, char **__restrict __endptr,
-		  int __base))
-{
-  return __strtoll_internal (__nptr, __endptr, __base, 0);
-}
-
-__extension__
-extern unsigned long long int __strtoull_internal (const char *
-						   __restrict __nptr,
-						   char **
-						   __restrict __endptr,
-						   int __base,
-						   int __group)
-  __THROW __nonnull ((1)) __wur;
-/* Like `strtoul' but convert to `uintmax_t'.  */
-__extern_inline uintmax_t
-__NTH (strtoumax (const char *__restrict __nptr, char **__restrict __endptr,
-		  int __base))
-{
-  return __strtoull_internal (__nptr, __endptr, __base, 0);
-}
-
-__extension__
-extern long long int __wcstoll_internal (const __gwchar_t *__restrict __nptr,
-					 __gwchar_t **__restrict __endptr,
-					 int __base, int __group)
-  __THROW __nonnull ((1)) __wur;
-/* Like `wcstol' but convert to `intmax_t'.  */
-__extern_inline intmax_t
-__NTH (wcstoimax (const __gwchar_t *__restrict __nptr,
-		  __gwchar_t **__restrict __endptr, int __base))
-{
-  return __wcstoll_internal (__nptr, __endptr, __base, 0);
-}
-
-
-__extension__
-extern unsigned long long int __wcstoull_internal (const __gwchar_t *
-						   __restrict __nptr,
-						   __gwchar_t **
-						   __restrict __endptr,
-						   int __base,
-						   int __group)
-  __THROW __nonnull ((1)) __wur;
-/* Like `wcstoul' but convert to `uintmax_t'.  */
-__extern_inline uintmax_t
-__NTH (wcstoumax (const __gwchar_t *__restrict __nptr,
-		  __gwchar_t **__restrict __endptr, int __base))
-{
-  return __wcstoull_internal (__nptr, __endptr, __base, 0);
-}
-
-# endif	/* __WORDSIZE == 32	*/
-#endif	/* Use extern inlines.  */
-
 __END_DECLS
 
 #endif /* inttypes.h */

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Remove strtoimax, strtoumax, wcstoimax, wcstoumax inlines
  2020-12-08 18:59 Remove strtoimax, strtoumax, wcstoimax, wcstoumax inlines Joseph Myers
@ 2020-12-09 20:25 ` Adhemerval Zanella
  0 siblings, 0 replies; 2+ messages in thread
From: Adhemerval Zanella @ 2020-12-09 20:25 UTC (permalink / raw)
  To: libc-alpha, Joseph Myers



On 08/12/2020 15:59, Joseph Myers wrote:
> inttypes.h has inline implementations of the strtoimax, strtoumax,
> wcstoimax and wcstoumax functions, despite the corresponding stdlib.h
> and wchar.h inlines having been removed in 2007 (commit
> 9b2e9577b228350b15d88303b00097dd58e8d29b).
> 
> Remove those inlines, thereby eliminating all references to the
> corresponding __*_internal functions from installed headers (so they
> could be made into compat symbols in future if desired).
> 
> Tested for x86_64 and x86.
> 

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> diff --git a/stdlib/inttypes.h b/stdlib/inttypes.h
> index 611a8b56c3..bcc56f6af6 100644
> --- a/stdlib/inttypes.h
> +++ b/stdlib/inttypes.h
> @@ -311,124 +311,6 @@ extern uintmax_t wcstoumax (const __gwchar_t *__restrict __nptr,
>  			    __gwchar_t ** __restrict __endptr, int __base)
>       __THROW;
>  
> -#ifdef __USE_EXTERN_INLINES
> -
> -# if __WORDSIZE == 64
> -
> -extern long int __strtol_internal (const char *__restrict __nptr,
> -				   char **__restrict __endptr,
> -				   int __base, int __group)
> -  __THROW __nonnull ((1)) __wur;
> -/* Like `strtol' but convert to `intmax_t'.  */
> -__extern_inline intmax_t
> -__NTH (strtoimax (const char *__restrict __nptr, char **__restrict __endptr,
> -		  int __base))
> -{
> -  return __strtol_internal (__nptr, __endptr, __base, 0);
> -}
> -
> -extern unsigned long int __strtoul_internal (const char *__restrict __nptr,
> -					     char ** __restrict __endptr,
> -					     int __base, int __group)
> -  __THROW __nonnull ((1)) __wur;
> -/* Like `strtoul' but convert to `uintmax_t'.  */
> -__extern_inline uintmax_t
> -__NTH (strtoumax (const char *__restrict __nptr, char **__restrict __endptr,
> -		  int __base))
> -{
> -  return __strtoul_internal (__nptr, __endptr, __base, 0);
> -}
> -
> -extern long int __wcstol_internal (const __gwchar_t * __restrict __nptr,
> -				   __gwchar_t **__restrict __endptr,
> -				   int __base, int __group)
> -  __THROW __nonnull ((1)) __wur;
> -/* Like `wcstol' but convert to `intmax_t'.  */
> -__extern_inline intmax_t
> -__NTH (wcstoimax (const __gwchar_t *__restrict __nptr,
> -		  __gwchar_t **__restrict __endptr, int __base))
> -{
> -  return __wcstol_internal (__nptr, __endptr, __base, 0);
> -}
> -
> -extern unsigned long int __wcstoul_internal (const __gwchar_t *
> -					     __restrict __nptr,
> -					     __gwchar_t **
> -					     __restrict __endptr,
> -					     int __base, int __group)
> -  __THROW __nonnull ((1)) __wur;
> -/* Like `wcstoul' but convert to `uintmax_t'.  */
> -__extern_inline uintmax_t
> -__NTH (wcstoumax (const __gwchar_t *__restrict __nptr,
> -		  __gwchar_t **__restrict __endptr, int __base))
> -{
> -  return __wcstoul_internal (__nptr, __endptr, __base, 0);
> -}
> -
> -# else /* __WORDSIZE == 32 */
> -
> -__extension__
> -extern long long int __strtoll_internal (const char *__restrict __nptr,
> -					 char **__restrict __endptr,
> -					 int __base, int __group)
> -  __THROW __nonnull ((1)) __wur;
> -/* Like `strtol' but convert to `intmax_t'.  */
> -__extern_inline intmax_t
> -__NTH (strtoimax (const char *__restrict __nptr, char **__restrict __endptr,
> -		  int __base))
> -{
> -  return __strtoll_internal (__nptr, __endptr, __base, 0);
> -}
> -
> -__extension__
> -extern unsigned long long int __strtoull_internal (const char *
> -						   __restrict __nptr,
> -						   char **
> -						   __restrict __endptr,
> -						   int __base,
> -						   int __group)
> -  __THROW __nonnull ((1)) __wur;
> -/* Like `strtoul' but convert to `uintmax_t'.  */
> -__extern_inline uintmax_t
> -__NTH (strtoumax (const char *__restrict __nptr, char **__restrict __endptr,
> -		  int __base))
> -{
> -  return __strtoull_internal (__nptr, __endptr, __base, 0);
> -}
> -
> -__extension__
> -extern long long int __wcstoll_internal (const __gwchar_t *__restrict __nptr,
> -					 __gwchar_t **__restrict __endptr,
> -					 int __base, int __group)
> -  __THROW __nonnull ((1)) __wur;
> -/* Like `wcstol' but convert to `intmax_t'.  */
> -__extern_inline intmax_t
> -__NTH (wcstoimax (const __gwchar_t *__restrict __nptr,
> -		  __gwchar_t **__restrict __endptr, int __base))
> -{
> -  return __wcstoll_internal (__nptr, __endptr, __base, 0);
> -}
> -
> -
> -__extension__
> -extern unsigned long long int __wcstoull_internal (const __gwchar_t *
> -						   __restrict __nptr,
> -						   __gwchar_t **
> -						   __restrict __endptr,
> -						   int __base,
> -						   int __group)
> -  __THROW __nonnull ((1)) __wur;
> -/* Like `wcstoul' but convert to `uintmax_t'.  */
> -__extern_inline uintmax_t
> -__NTH (wcstoumax (const __gwchar_t *__restrict __nptr,
> -		  __gwchar_t **__restrict __endptr, int __base))
> -{
> -  return __wcstoull_internal (__nptr, __endptr, __base, 0);
> -}
> -
> -# endif	/* __WORDSIZE == 32	*/
> -#endif	/* Use extern inlines.  */
> -
>  __END_DECLS
>  
>  #endif /* inttypes.h */
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-09 20:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-08 18:59 Remove strtoimax, strtoumax, wcstoimax, wcstoumax inlines Joseph Myers
2020-12-09 20:25 ` Adhemerval Zanella

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).