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 2: Handle string constant initializers for array of char16_t or char32_t


Hi,

Thanks for asking about this because I was temporarily destracted by some other
issues and didn't re-ping to get final confirmation that the patch from April 
oncerning string constant initializers could be commited.

As soon as I can complete the testsuite runs for each patch (I'll line up all
threee one after the other), I'll post them again and hopefully can get
approval on them quickly.  Since the April one was already reviewed, and the
other two are fairly trivial, it ought to be fairly easy.

Thank you also for the suggestion on the typeinfo support.  I somehow missed
the RTTI typeinfo ABI information which is where I was left when my attention
shifted elsewhere for a while.  I'll check with Paolo on the versioning and
such.  I'll make sure to credit you in the changelog.

	Cheers,
	Kris

On Mon, Jul 14, 2008 at 11:54:40AM +0200, Holger Hopp wrote:
> 
> Hi Kris,
> 
> can you please tell me what the current status of the
> char16_t/char32_t implementation is? As far as I see
> 
> - your second patch from April (handling string constant initializers)
>   was fine, but not yet committed to trunk. I can see no reason to
>   hold back this patch. 
> - Your proposed __CHAR16_TYPE__ and __CHAR32_TYPE__ macros are also
>   not yet implemented.
> - The missing C++ typeinfo (I mentioned before) is not yet added to
>   libstdc++. I have a proposal appended here.
> 
> When you commit your patches, can you please also add the typeinfo
> stuff. I'm not sure about versioning and I have no svn write access.
> 
> Holger
> 
> 
> Proposed patch for char16_t/char32_t typeinfo:
> 
> Index: gcc/cp/rtti.c
> ===================================================================
> --- gcc/cp/rtti.c       (revision 137312)
> +++ gcc/cp/rtti.c       (working copy)
> @@ -1409,6 +1409,7 @@
>      &void_type_node,
>      &boolean_type_node,
>      &wchar_type_node,
> +    &char16_type_node, &char32_type_node,
>      &char_type_node, &signed_char_type_node, &unsigned_char_type_node,
>      &short_integer_type_node, &short_unsigned_type_node,
>      &integer_type_node, &unsigned_type_node,
> Index: libstdc++-v3/config/abi/pre/gnu.ver
> ===================================================================
> --- libstdc++-v3/config/abi/pre/gnu.ver (revision 137312)
> +++ libstdc++-v3/config/abi/pre/gnu.ver (working copy)
> @@ -1019,3 +1019,15 @@
>      _ZTIN10__cxxabiv119__foreign_exceptionE;
> 
>  } CXXABI_1.3.1;
> +
> +CXXABI_1.3.3 {
> +
> +    # typeinfo char16_t and char32_t
> +    _ZTIu8char16_t;
> +    _ZTIPu8char16_t;
> +    _ZTIPKu8char16_t;
> +    _ZTIu8char32_t;
> +    _ZTIPu8char32_t;
> +    _ZTIPKu8char32_t;
> +
> +} CXXABI_1.3.2;
> 
> 
> On Tue, 29 Apr 2008 14:01:23 -0400,
> Kris Van Hees <kris.van.hees@oracle.com> wrote:
> 
> > On Tue, Apr 22, 2008 at 07:01:18PM +0000, Joseph S. Myers wrote:
> >> On Tue, 22 Apr 2008, Kris Van Hees wrote:
> >> 
> >> > On Tue, Apr 22, 2008 at 01:25:22PM -0400, Jakub Jelinek wrote:
> >> > > On Tue, Apr 22, 2008 at 01:09:48PM -0400, Kris Van Hees wrote:
> >> > > > 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++.
> >> > > 
> >> > > Wouldn't it be desirable to predefine __CHAR16_TYPE__ and __CHAR32_TYPE__
> >> > > macros for C though, similarly how is c_stddef_cpp_builtins predefines
> >> > > __WCHAR_TYPE__ or __SIZE_TYPE__?
> >> > 
> >> > That is a very good point.  I'll do that.
> >> 
> >> These types should always be the same as __UINT_LEAST16_TYPE__ and 
> >> __UINT_LEAST32_TYPE__.  See PR 448 and discussions on the gcc list.  
> >> Since it may be a while before GCC has proper knowledge of all the 
> >> <stdint.h> types everywhere, defining __CHAR16_TYPE__ and __CHAR32_TYPE__ 
> >> (as well as eventually defining macros for everything in <stdint.h>) may 
> >> make sense.  However, please make clear in the documentation that the 
> >> choice of these types (among multiple types with the same precision, e.g. 
> >> unsigned int and unsigned long) is subject to change in order to agree 
> >> with <stdint.h> as required by the C TR, and as such they should not be 
> >> used in C++ interfaces (because of the effects on mangling); the 
> >> fundamental types char16_t and char32_t should be used in C++ instead.
> >
> > The definition of the two macros for __CHAR16_TYPE__ and __CHAR32_TYPE__ is
> > definitely something that I'll send a patch for, but since that is not really
> > related to the patch this thread came out of, I'd like to suggest we do not
> > hold back this patch for that?  It seems to be two issues that are sufficiently
> > separate.
> >
> > 	Cheers,
> > 	Kris


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