This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/27715] Extented ASCII characters lead to wrong "CASE" selection
- From: "fxcoudert at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Jun 2006 15:44:23 -0000
- Subject: [Bug fortran/27715] Extented ASCII characters lead to wrong "CASE" selection
- References: <bug-27715-10601@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #12 from fxcoudert at gcc dot gnu dot org 2006-06-01 15:44 -------
(In reply to comment #11)
> Index: arith.c
> ===================================================================
> --- arith.c (revision 114111)
> +++ arith.c (working copy)
> @@ -1133,8 +1133,10 @@ gfc_compare_string (gfc_expr * a, gfc_ex
>
> for (i = 0; i < len; i++)
> {
> - ac = (i < alen) ? a->value.character.string[i] : ' ';
> - bc = (i < blen) ? b->value.character.string[i] : ' ';
> + /* We cast to unsigned char because default char, if it is signed,
> + would lead to ac<0 for string[i] > 127. */
> + ac = (unsigned char) ((i < alen) ? a->value.character.string[i] : ' ');
> + bc = (unsigned char) ((i < blen) ? b->value.character.string[i] : ' ');
>
> if (xcoll_table != NULL)
> {
OK. Although I still like better my previous patch, there's no point arguing
over this for years. Go ahead!
--
fxcoudert at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
URL|http://gcc.gnu.org/ml/fortra|
|n/2006-05/msg00489.html |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27715