Remove strtoimax, strtoumax, wcstoimax, wcstoumax inlines

Adhemerval Zanella adhemerval.zanella@linaro.org
Wed Dec 9 20:25:16 GMT 2020



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 */
> 


More information about the Libc-alpha mailing list