Re: [RFC/RFA] Cleaner handling of character entities ?

Jim Blandy
2006-05-05T21:47:09Z

Daniel Jacobowitz <drow@false.org> writes:
> On Fri, May 05, 2006 at 12:40:02PM -0700, Jim Blandy wrote:
>>
>> Joel Brobecker <brobecker@adacore.com> writes:
>> > We would be left with:
>> >
>> > * dwarf2read.c (read_base_type): Set code to TYPE_CODE_CHAR
>> > for char and unsigned char types of Ada compilation units.
>> > * ada-lang.c (ada_is_character_type): Always return true if
>> > the type code is TYPE_CODE_CHAR.
>> >
>> > Would that be OK?
>>
>> Yeah, I think that sounds like the right thing.
>
> Alternatively, do we think we ought to be using TYPE_CODE_CHAR, and if
> so, should we try it?

If we do that, we're effectively signing up to go through GDB and make
CHAR cases behave more like the INT cases. Which makes that code less
likely to work properly in languages that really do distinguish the
two.

I think we should reserve the TYPE_CODE_INT / TYPE_CODE_CHAR
distinction for use in source languages that really make the
distinction, and let languages where characters are just another kind
of integer use TYPE_CODE_INT for everything.