This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix wide charater literals (was Re: [RFC] Unexpected compiler twist of the wcscoll issue)
- From: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Richard Henderson <rth at redhat dot com>, Paolo Carlini <pcarlini at unitus dot it>,gcc-patches at gcc dot gnu dot org
- Date: Tue, 12 Mar 2002 18:31:51 +0000
- Subject: Re: [PATCH] Fix wide charater literals (was Re: [RFC] Unexpected compiler twist of the wcscoll issue)
- References: <3C8DF94C.D182C65D@unitus.it> <20020312170140.Q2204@sunsite.ms.mff.cuni.cz>
Jakub Jelinek wrote:-
> Here is a fix (note that pre-3.0 c-lex used here token_getch which
> gave unsigned character in int variable, not signed).
> --- gcc/c-lex.c.jj Fri Feb 1 14:34:16 2002
> +++ gcc/c-lex.c Tue Mar 12 16:46:12 2002
> @@ -1333,7 +1333,7 @@ lex_string (str, len, wide)
> c = wc;
> }
> #else
> - c = *p++;
> + c = *(const unsigned char *) p++;
> #endif
>
I think you should make p and limit a const unsigned char *. Then,
rather than adding a cast, you can take a lot away, including the caller
and the functions it calls.
Note that just above the above lines there is another c = *p++; which
has no reason to be different.
Neil.