Article View: gnu.g++
Article #315Problem and Fix in Libg++ 1.25.0
From: Steve Simmons
Date: Wed, 05 Oct 1988 03:57
Date: Wed, 05 Oct 1988 03:57
70 lines
2345 bytes
2345 bytes
This could be a gcc problem, could be a g++ problem, could be a
libg++ problem. Most likely it's just some trivia in a some library
routine source. No matter what it's easily fixed.
Building libg++ 1.25.0 on a 4.3 VAX. Using g++ 1.27, gcc 1.28. When
compiling regex.c, I get
>gcc -g -O -I/usr/local/lib/g++-include -c regex.c
>
>regex.c:1484: warning: `bcmp_translate' was declared implicitly `extern' and later `static'
This was easily fixed by moving the bcmp_translate function to
earlier in the file. The cdiff follows:
*** regex.c Tue Oct 4 23:45:26 1988
--- regex.c.dist Tue Oct 4 23:40:50 1988
***************
*** 967,988 ****
int re_max_failures = 2000;
-
- static int
- bcmp_translate (s1, s2, len, translate)
- unsigned char *s1, *s2;
- register int len;
- unsigned char *translate;
- {
- register unsigned char *p1 = s1, *p2 = s2;
- while (len)
- {
- if (translate [*p1++] != translate [*p2++]) return 1;
- len--;
- }
- return 0;
- }
-
/* Match the pattern described by PBUFP
against data which is the virtual concatenation of STRING1 and STRING2.
SIZE1 and SIZE2 are the sizes of the two data strings.
--- 967,972 ----
***************
*** 1493,1498 ****
--- 1477,1497 ----
else break; /* Matching at this starting point really fails! */
}
return -1; /* Failure to match */
+ }
+
+ static int
+ bcmp_translate (s1, s2, len, translate)
+ unsigned char *s1, *s2;
+ register int len;
+ unsigned char *translate;
+ {
+ register unsigned char *p1 = s1, *p2 = s2;
+ while (len)
+ {
+ if (translate [*p1++] != translate [*p2++]) return 1;
+ len--;
+ }
+ return 0;
}
/* Entry points compatible with bsd4.2 regex library */
--
Steve Simmons ...!umix!itivax!scs
Industrial Technology Institute, Ann Arbor, MI.
"You can't get here from here."
Technical Details
Message-ID:
<292@itivax.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!uunet!tut.cis.ohio-state.edu!mailrus!umich!itivax!gnuShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!uunet!tut.cis.ohio-state.edu!mailrus!umich!itivax!gnu From: gnu@itivax.UUCP ( Steve Simmons) Newsgroups: gnu.g++,gnu.gcc Subject: Problem and Fix in Libg++ 1.25.0 Keywords: regex Message-ID: <292@itivax.UUCP> Date: 5 Oct 88 03:57:01 GMT Reply-To: scs@itivax.uucp Organization: Industrial Technology Institute, Ann Arbor Lines: 69