Does --enable-clocale=gnu work on Linux/ia64?

Benjamin Kosnik bkoz@redhat.com
Fri Nov 16 06:41:00 GMT 2001


> > Well, on x86 and powerpc, wchar_t is long int. Gcc won't complain about
> > casting from char* to wchar_t. However, on ia64, wchar_t is int. Gcc is
> > not very happy. I think that part of libstdc++ is pretty much broken.

Backstory for Ulrich.

> 2001-11-25  H.J. Lu <hjl@gnu.org>
> 
> 	* config/locale/moneypunct_members_gnu.cc
> 	(_M_initialize_moneypunct): Cast "char *" to "long int" before
> 	casting to wchar_t for _NL_NUMERIC_DECIMAL_POINT_WC and
> 	_NL_NUMERIC_THOUSANDS_SEP_WC.
> 	* config/locale/numpunct_members_gnu.cc 
> 	(_M_initialize_numpunct): Likewise.
> 
> -	  _M_decimal_point = reinterpret_cast<wchar_t>(__nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc));
> -	  _M_thousands_sep = reinterpret_cast<wchar_t>(__nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC,__cloc));
> +	  long int ch;
> +	  ch = reinterpret_cast<long int>(__nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc));
> +	  _M_decimal_point = (wchar_t) ch;

C++ style casts, like        static_cast<wchar_t>(ch);

Looks ok to me. Uli?

Did you try this on x86 and ia64?

-benjamin



More information about the Gcc mailing list