This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [PATCH] Fix wide charater literals (was Re: [RFC] Unexpected compiler twist of the wcscoll issue)


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.


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