This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Revision 2: Handle string constant initializers for array of char16_t or char32_t
Hi Kris,
On Tue, 22 Apr 2008 13:09:48 -0400,
Kris Van Hees <kris.van.hees@oracle.com> wrote:
> On Tue, Apr 22, 2008 at 06:03:59PM +0200, Holger Hopp wrote:
>> Hi Kris,
>>
>> - char16_t and char32_t are builtin types in C++, but not in C.
>> This IMO no good idea, because it violates some fundamental
>> compatibility rules between C and C++.
>
> According to the ISO/IEC JTC1 SC22 WG14 N1040 technical report for C (covering
> the new character data types for char16_t and char32_t), typedefs are
> introduced for char16_t and char32_t, which would imply that they are not
> fundamental types in C. On the other hand, ISO/IEC JTC1 SC22 WG21 N2249
> specifically identifies char16_t and char32_t as fundamental types in C++.
You're right. Bad situation, but that are the current standards and it
is similar to wchar_t.
But I have another issue when using the new builtin types char16_t and
char32_t in sophisticated C++ code. The typeinfo for the new types is
missing in libstdc++.so.6.0.11:
objdump -Ct ..../libstdc++.so.6.0.11 | grep "typeinfo for char"
00000000001e12e0 w O .data 0000000000000010 typeinfo for char
00000000001e12a0 w O .data 0000000000000020 typeinfo for char const*
00000000001e12c0 w O .data 0000000000000020 typeinfo for char*
Holger