Skip to main content.
home | support | download

Back to List Archive

swish-e 1.3.1 - won't compile on Solaris 2.6 (SPARC) w/ Sun workshop C

From: Steve van der Burg <steve.vanderburg(at)>
Date: Mon Jan 18 1999 - 21:34:29 GMT
I just started looking at swish-e last week, and after successfully
installing 1.2.4 here (Solaris 2.6 (Sparc), Sun's workshop C compiler
4.2) I noticed 1.3.1 today, downloaded it, and the compiler bombed with
this in http.c:

/opt/SUNWspro/bin/cc -c -g http.c
"http.c", line 261: non-constant initializer: op "NAME"
"http.c", line 264: non-constant initializer: op "NAME"
cc: acomp failed for http.c

The first line in question is this:
   char *commandline[] = { perlpath, spiderprogram, spiderfilesbasename,
url, 0 };

I don't see why the compiler should have a problem with the assignment
-- trial and error identified "url" as the culprit.  I thought it might
be an optimizer problem first, but that wasn't it.

Anyway, here's a workaround if you're on the same platform and see this

if (*perlpath) {
    char *commandline[] = { perlpath, spiderprogram,
spiderfilesbasename, 0, 0 };
    commandline[3] = url;
    rv = run(commandline);
} else {
    char *commandline[] = { spiderprogram, spiderfilesbasename, 0, 0 };
    commandline[2] = url;
    rv = run(commandline);

Once "url" is replaced by a constant in the { } initializer, and then
changed to point to what it's supposed to (each time), the compiler is
happy and life is good again.

Steve van der Burg
Technical Analyst, Information Services
London Health Sciences Centre
London, Ontario, Canada
Received on Mon Jan 18 13:30:41 1999