This is the mail archive of the mailing list for the libstdc++ project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

wide character issues with gcc 3.2

Previously I sent this to "", but it seems to be an issue with basic_string, so this may be a more apporpriate list. (And Benjamin Kosnik suggested it.)

Gcc 3.2 on linux compiles and links our app, but -fshort-wchar doesn't seem to be working completely. The compiler directive 'L' converts character strings properly, and wchar_t is the right size. The problem is that "basic_string<wchar_t>" still thinks everything is 4-bytes.

basic_string<wchar_t> foo = L"foo";
foo[0] is 'f'
foo[1] is 'o'
foo[2] is uninitialized


basic_string<wchar_t> bar;
bar.c_str[0] is 'b'
bar.c_str[1] is 0
bar.c_str[2] is 'a'
bar.c_str[3] is 0
bar.c_str[4] is 'r'
bar.c_str[5] is 0

$ gcc -v
Reading specs from /home/shared/local/lib/gcc-lib/i686-pc-linux-gnu/3.2/specs
Configured with: ../gcc-3.2/configure --prefix=/home/shared/local --enable-shared --enable-threads=posix --enable-__cxa_atexit
Thread model: posix
gcc version 3.2

Send and receive Hotmail on your mobile device:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]