This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Revision 3: utf-16 and utf-32 support in C and C++
- From: "Danny Smith" <dansmister at gmail dot com>
- To: "Kris Van Hees" <kris dot van dot hees at oracle dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 2 May 2008 15:13:39 +1200
- Subject: Re: [PATCH] Revision 3: utf-16 and utf-32 support in C and C++
- References: <20080415200017.GA3887@oracle.com>
On Wed, Apr 16, 2008 at 8:00 AM, Kris Van Hees <kris.van.hees@oracle.com> wrote:
> Oracle has a full copyright assignment in place with the FSF.
>
> Please refer to the following message in the archives for the original
> posting of this patch:
>
> http://gcc.gnu.org/ml/gcc-patches/2008-03/msg00827.html
>
The utf16-4.c and utf32-4.c tests and their C++ counterparts
added here
2008-04-18 Kris Van Hees <kris.van.hees@oracle.com>
Tests for char16_t and char32_t support.
...
* g++.dg/ext/utf16-4.C: New
...
* g++.dg/ext/utf32-4.C: New
...
* gcc.dg/utf16-4.c: New
...
* gcc.dg/utf32-4.c: New
Fail on mingw32.
wchar_t on mingw32 is unsigned short. Thus, line 18 in each of the four
testcases:
char16_t c9 = L'\U00064321';
emits
"warning: character constant too long for its type"
rather than the "implicit truncation" warning for char16_t and no
warning for char32_t.
This can be avoided by only testing the line on targets with at least
4-byte wchar_t, eg
#if (__SIZEOF_WCHAR_T >= 4)
char16_t c9 = L'\U00064321'; /* { dg-warning "implicitly truncated" } */
#endif
Is that the right thing to do?
Danny