This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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: [RFC-v4] Handle cygwin wchar_t specifics


>>>>> "Pierre" == Pierre Muller <pierre.muller@ics-cnrs.unistra.fr> writes:

Pierre> 1) we should really use "gdb_wchar_t" type, not "wchar_t"

Yeah.

Pierre> 2) If sizeof(gdb_wchar_t) == 1
Pierre> I don't think that UTF-8LE and UTF-8BE exist, do they?
Pierre> At least they are not in the iconv -l list for current cygwin.

A platform where this is true should not define __STDC_ISO_10646__.
You might as well just assert that the size is 2 or 4.

Pierre> 3) WORD_BIGENDIAN is not defined at all on Cygwin,
Pierre> so that your code would probably not compile.

Yeah, I forgot, you need #if.  See config.in.

Pierre> A further question is whether UTF-32 is always supported...

If someone can find a platform where wchar_t is 4 bytes, where
__STDC_ISO_10646__ is defined, and where UTF-32 is not understood, then
we can complain bitterly and change the code again.

Pierre> Below is yet another proposal:
Pierre> it transforms INTERMEDIATE_ENCODING macro into a call to
Pierre> intermediate_encoding function.

I'd prefer it if the new code is only used in the __STDC_ISO_10646__
case.

Pierre> +#ifdef WORDS_BIGENDIAN

#if

Pierre> +const char *
Pierre> +intermediate_encoding (void)

New functions require an introductory comment.

Pierre>  #ifdef PHONY_ICONV
Pierre> -#define INTERMEDIATE_ENCODING "wchar_t"
Pierre> +#define DEFAULT_INTERMEDIATE_ENCODING "wchar_t"

I don't think DEFAULT_INTERMEDIATE_ENCODING is needed.

Tom


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