This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH,gfortran] Remove homegrown isdigit and isalpha in module.c
DJ Delorie wrote:
>>Modules are of course compiler-generated, but it would be safer and not much
>>more complicated to say
>> else if ('a' <= c <= 'z' || 'A' <= c <= 'Z')
>>instead.
>
>
> It would be wrong to do this. Of the two most popular charset
> encodings (ascii and ebcdic), only one (ascii) has the alphabet in
> sequence like that.
I spotted one more issues of this kind in primary.c, and considering DJ's
comment, I committed this as obvious after the obligatory bubblestrapping and
testing.
- Tobi
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/ChangeLog,v
retrieving revision 1.292
diff -u -p -r1.292 ChangeLog
--- ChangeLog 14 Jan 2005 11:55:04 -0000 1.292
+++ ChangeLog 15 Jan 2005 22:35:17 -0000
@@ -1,3 +1,8 @@
+2005-01-15 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de
+
+ * primary.c (check_digit): Call 'ISXDIGIT' instead of assuming
+ ASCII-like character encoding.
+
2005-01-14 Steven G. Kargl <kargls@comcast.net>
* resolve.c (compare_case): Cleanup.
Index: primary.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/primary.c,v
retrieving revision 1.15
diff -u -p -r1.15 primary.c
--- primary.c 3 Jan 2005 21:43:50 -0000 1.15
+++ primary.c 15 Jan 2005 22:35:18 -0000
@@ -1,5 +1,6 @@
/* Primary expression subroutines
- Copyright (C) 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2002, 2004, 2005 Free Software Foundation,
+ Inc.
Contributed by Andy Vaught
This file is part of GCC.
@@ -114,7 +115,7 @@ check_digit (int c, int radix)
break;
case 16:
- r = ('0' <= c && c <= '9') || ('a' <= c && c <= 'f');
+ r = ISXDIGIT (c);
break;
default: