This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Ada.Characters.{Wide_}Latin_9 should be deleted
- From: Florian Weimer <fw at deneb dot enyo dot de>
- To: David Starner <starner at okstate dot edu>
- Cc: gcc at gcc dot gnu dot org
- Date: Sat, 18 May 2002 13:08:02 +0200
- Subject: Re: Ada.Characters.{Wide_}Latin_9 should be deleted
- References: <20020430082254.GA1000@x8b4e50c5.dhcp.okstate.edu>
David Starner <starner@okstate.edu> writes:
> Ada.Characters.Latin_9 and Ada.Characters.Wide_Latin_9 are new packages
> added to GCC 3.2. In my opinion, both should be removed before release,
> with proper internationization added in their place if neccesary.
Unfortunately, adding proper i18n support for GNAT on GNU systems is
not possible: GNAT only supports a 16-bit Wide_Character type, but
wchar_t is 32 bit on GNU systems. This means that it is cumbersome to
use the GNU facilities from Ada. For example, if you add a new
(private) type for a character at your own, you can't use case
statements to process such characters, and you cannot declare string
constants in preelaborated packages.
It's not clear if Ada as a language will mandate or encourage the
provision of an UCS-4 encoded character type (there seems to be a
tenancy against it). I strongly believe that we need such a type in
GNAT, for interoperation with the rest of the GNU system. However, we
shouldn't create interfaces now which will become incompatible later.
> The reason is that hard coding character set into the code is a bad
> idea and that it's unreasonable and unhelpful to add one arbitrary
> new 8-bit character set to the Ada library. (Character.Wide_Latin_9
> has additional problems, as it creates a pseudo-Unicode.)
I agree. At least Wide_Latin_9 is a serious mistake and has to be
removed. I'll submit a patch.
I'm not so sure about Latin_9; maybe a distinct character type can be
used?