[gnu.gcc] Problem and Fix in Libg++ 1.25.0

gnu@itivax.UUCP ( Steve Simmons) (10/05/88)

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."