On Wed, 30 May 2012, H.J. Lu wrote:

> On Linux/i386:

> long int

> On Linux/x86-64:
> 
> [hjl@gnu-6 include]$ echo __WCHAR_TYPE__ | gcc -m32 -E -

> int

That's a bug.  Not a very serious one - it doesn't affect C++ name 
mangling because wchar_t is a built-in type in C++, with its own mangling 
- but still a bug.  The choice of underlying type for wchar_t should not 
depend on what the compiler defaults to like that.  (Actually, it looks 
like a 32-bit-default compiler built --enable-targets=all also uses "int" 
here.)

The types of WCHAR_MIN and WCHAR_MAX in both stdint.h and wchar.h need to 
correspond correctly to the underlying type of wchar_t.  GCC's stdint.h 
gets this right automatically, glibc has bits/wchar.h with a special 
sysdeps/unix/sysv/linux/i386 version to use "long".

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to