This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Fix typo in type of parameter "w" in print_wchar...
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: brobecker at adacore dot com
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 7 May 2009 20:52:37 +0200 (CEST)
- Subject: Re: [RFA] Fix typo in type of parameter "w" in print_wchar...
- References: <20090425003658.GA32745@adacore.com> <200904250849.n3P8n5BU002469@brahms.sibelius.xs4all.nl> <20090507183753.GE659@adacore.com>
> Date: Thu, 7 May 2009 11:37:53 -0700
> From: Joel Brobecker <brobecker@adacore.com>
>
> > I think this is wrong. The type of a single wide character is wint_t
> > instead of wchar_t such that it can properly hold WEOF, much in the
> > same way as the "normal" character functions use int instead of char.
>
> Thanks for the hint, Mark. Does the following look correct to you?
> I've just tested that it also fixes the issue on AIX, and I got no
> regression on amd64-linux.
>
> 2009-05-07 Joel Brobecker <brobecker@adacore.com>
>
> * c-lang.c (print_wchar): Convert w into a gdb_wchar_t before
> pushing it on the output obstack.
>
> + gdb_wchar_t wchar = (gdb_wchar_t) w;
Is that cast necessary?
Otherwise, this looks excellent to me.