This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Checking wide format strings
- To: <gcc at gcc dot gnu dot org>
- Subject: Re: Checking wide format strings
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- Date: Sat, 9 Dec 2000 17:31:16 +0000 (GMT)
On Wed, 6 Dec 2000, Jakub Jelinek wrote:
> On Wed, Dec 06, 2000 at 02:09:17PM +0000, Joseph S. Myers wrote:
> > 1. Could someone add the relevant information where c-tree.texi says
> >
> > FIXME: How are wide strings represented?
>
> I came accross this when writing the designated initializers patch as well,
> had to write wide char handling myself.
> Probably it would be good if there was some function like
> read_wide_string(tree wstr, tree pos) which would read POSth wide character
> from wide string constant wstr and return it as a tree of type
> wchar_type_node.
Could we also have a better way of determining whether a string constant
is narrow or wide than looking at its type? Looking at its type doesn't
work when wchar_t is char; and though a bug in the C99 standard means that
wchar_t can be signed char or unsigned char but not plain char, I'm not
convinced that the few targets using char for wchar_t should be changed to
signed or unsigned char on account of that bug.
--
Joseph S. Myers
jsm28@cam.ac.uk