This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: FIXINCL goes into an infinite loop on alpha-osf4
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Subject: Re: FIXINCL goes into an infinite loop on alpha-osf4
- From: Zack Weinberg <zack at wolery dot cumb dot org>
- Date: Sun, 23 Jan 2000 20:47:17 -0800
- Cc: bkorb at sco dot com, gcc-bugs at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- References: <200001240334.WAA05617@caip.rutgers.edu>
Argh. I'll take 'forgot to increment pointer' for $100, Alex. With a
side dish of 'identifiers can have underscores in them.'
Patch appended. Thanks for the test case.
zw
* fixfixes.c (fix_char_macro_uses): Correct regular expression
to allow underscores in macro names.
(fix_char_macro_defines): Increment scanning pointer.
===================================================================
Index: fixfixes.c
--- fixfixes.c 2000/01/22 00:40:49 1.9
+++ fixfixes.c 2000/01/24 04:36:32
@@ -378,7 +378,7 @@ fix_char_macro_uses (text, str)
/* This regexp looks for a traditional-syntax #define (# in column 1)
of an object-like macro. */
static const char pat[] =
- "^#[ \t]*define[ \t]+[A-Za-z][A-Za-z0-9]*[ \t]+";
+ "^#[ \t]*define[ \t]+[_A-Za-z][_A-Za-z0-9]*[ \t]+";
static regex_t re;
regmatch_t rm[1];
@@ -486,6 +486,7 @@ fix_char_macro_defines (text, str)
{
if (*p == str[0] && !strncmp (p+1, str+1, len-1))
goto found;
+ p++;
}
while (isalpha (*p) || isalnum (*p) || *p == '_');
/* Hit end of macro name without finding the string. */