[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[patch] sed 4.0b: regcomp.c with gcc 2.95
From: |
Adrian Bunk |
Subject: |
[patch] sed 4.0b: regcomp.c with gcc 2.95 |
Date: |
Fri, 19 Dec 2003 19:36:50 +0100 |
User-agent: |
Mutt/1.4.1i |
I got the following compile error in sed 4.0b using gcc 2.95.3:
<-- snip -->
...
gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../lib -I../intl -I.. -I../lib -O2
-mcpu=v8 -c regex.c
...
regcomp.c: In function `parse_bracket_exp':
regcomp.c:3050: parse error before `int'
regcomp.c:3062: `first_round' undeclared (first use in this function)
regcomp.c:3062: (Each undeclared identifier is reported only once
regcomp.c:3062: for each function it appears in.)
...
gmake[2]: *** [regex.o] Error 1
gmake[2]: Leaving directory `/aux/adrian/build/sed-4.0b/lib'
<-- snip -->
gcc 2.95 doesn't like declarations and code mixed. The fix is simple:
--- sed-4.0b/lib/regcomp.c.old 2003-12-19 19:35:03.000000000 +0100
+++ sed-4.0b/lib/regcomp.c 2003-12-19 19:24:19.000000000 +0100
@@ -2988,6 +2988,7 @@
#endif /* not RE_ENABLE_I18N */
bin_tree_t *work_tree;
int token_len;
+ int first_round;
#ifdef _LIBC
collseqmb = (const unsigned char *)
_NL_CURRENT (LC_COLLATE, _NL_COLLATE_COLLSEQMB);
@@ -3047,7 +3048,7 @@
if (token->type == OP_CLOSE_BRACKET)
token->type = CHARACTER;
- int first_round = 1;
+ first_round = 1;
while (1)
{
bracket_elem_t start_elem, end_elem;
Please apply
Adrian
--
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [patch] sed 4.0b: regcomp.c with gcc 2.95,
Adrian Bunk <=