This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

Re: [PATCH] Revision 3: utf-16 and utf-32 support in C and C++


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


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