[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
grep 2.5a fails compilation on Solaris
From: |
Keith Thompson |
Subject: |
grep 2.5a fails compilation on Solaris |
Date: |
Wed, 4 Oct 2000 03:42:23 -0700 (PDT) |
I just tried to build grep-2.5a on a Sparc workstation running Solaris 7
(config.guess says "sparc-sun-solaris2.7") using gcc 2.95.2. I got a
compilation error in search.c:
search.c:436: parse error before `*'
search.c:436: warning: data definition has no type or storage class
The offending line is:
static pcre *cre[255];
Presumably the type pcre is defined in <pcre.h>, which I don't have.
The "#include <pcre.h>" directive, as well as most references to type
pcre, are protected by "#ifdef HAVE_LIBPCRE" directives or equivalent.
The declaration on line 436 isn't.
Here's a patch that fixes the problem:
========================================================================
*** search.c,01 Wed Mar 22 20:43:00 2000
--- search.c Wed Oct 4 03:33:49 2000
***************
*** 432,439 ****
--- 432,441 ----
static int sub[300]; /* Could be less for grep, since we'll not be
* using grouping quite often. We'll need at least
* a few to allow back-references like \1 */
+ #ifdef HAVE_LIBPCRE
static int n_pcre = 0;
static pcre *cre[255];
+ #endif /* HAVE_LIBPCRE */
static void
Pcompile (char *pattern, size_t size)
========================================================================
Also, a couple of typos:
In search.c, "It can be fetch at" should be "It can be fetched at".
In the first paragraph of NEWS, "interpert" should be "interpret".
--
Keith Thompson (The_Other_Keith) address@hidden <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://www.sdsc.edu/~kst>
Welcome to the last year of the 20th century.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- grep 2.5a fails compilation on Solaris,
Keith Thompson <=