Article View: news.software.nn
Article #8004Re: nn 6.5.1 build error in 'db.c' with CACHE_PURPOSE is defined
From: Matthew England
Date: Wed, 11 Sep 1996 00:00
Date: Wed, 11 Sep 1996 00:00
68 lines
2967 bytes
2967 bytes
cdewick@jedi.apana.org.au (Craig Dewick) writes:
>When attempting to build nn-6.5.1 on this machine, a Sun 4/380 running
>SunOS 4.1.4 with gcc-2.6.3, I encountered a problem with 'db.c'.
>make -f ymakefile all
>make[1]: Entering directory `/mnt/azwan/nn-6.5.1'
>cc -Iconf -O -c db.c
>"db.c", line 1233: syntax error at or near variable name "const"
>"db.c", line 1237: const undefined
>make[1]: *** [db.o] Error 1
>make[1]: Leaving directory `/mnt/azwan/nn-6.5.1'
>make: *** [all] Error 2
(fyi, many folks name their GNU C executable "gcc" so that they can
still access their "native" compiler if need be.)
>Here's the code fragment from 'db.c'
>#ifdef CACHE_PURPOSE
>static int
>purpcmp(p0, p1)
>const void *p0, *p1; <---- this is line 1233
>{
> return strcmp( ((struct purp_list *)p0)->group_name,
> ((struct purp_list *)p1)->group_name );
>}
fyi, the 'const' keyword is new to ANSI C compared to the language
specified in the original book written by Kernigan & Ritchie, which is
commonly referred to as K&R C. Or so Kernigan & Ritchie Second Edition
says.
Have you tried running gcc with the -ansi switch (it doesn't appear
that it's used above)? eg, here is the makefile header that I used for
my 6.5.1 build over the weekend on a Solaris2 (SunOS 5.4 in this case;
SunOS 4.1.x, for the most part, is commonly referred to as Solaris1)
machine:
--
CC = /usr/local/bin/gcc -ansi
#CPP = /opt/gnu/lib/gcc-lib/sparc-sun-solaris2/2.5.6/cpp
CPP = $(CC) -E
#CFLAGS = -O2 # -g # -I/usr/local/lib/malloc-debug -DMALLOC_FUNC_CHECK
CFLAGS = -O
#-Wall -Wcomment \
#-Wtraditional -Wshadow \
#-Wpointer-arith -Wcast-qual -Wcast-align -Wconversion \
#-Waggregate-return -Wmissing-prototypes -Wnested-externs
#LDFLAGS = -s # -lmalloc # /usr/local/lib/malloc-debug/libmalloc.a
MAKE = /usr/local/bin/gmake
--
Notice the first line.
I haven't tried building on a Solaris1 machine (we've got a couple of
them that can run gcc) yet. Let me know if you're have problems after
using '-ansi' and I'll try it on my system.
Matt
--
Matthew England
Systems Engineer | voice: (630) 325-4151
National Peripherals Inc. (NPI), an MTI Company | fax: (630) 325-4230
1111 Pasquinelli Drive, Westmont, IL, 60559, USA | mengland@npi.com
Technical Details
Message-ID:
<516f32$3h2@xx.NPI.COM>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nn.mbox.zip!not-for-mailReferences:
<5141e4$fls@jedi.apana.org.au>Show Full Headers
Complete Article Headers
Message-ID: <516f32$3h2@xx.NPI.COM> Subject: Re: nn 6.5.1 build error in 'db.c' with CACHE_PURPOSE is defined Date: Wed, 11 Sep 1996 00:00:00 +0000 From: mengland@npi.com (Matthew England) References: <5141e4$fls@jedi.apana.org.au> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nn.mbox.zip!not-for-mail X-Deja-AN: 179964807 Organization: MTI Open Systems Group, Westmont, IL Reply-to: mengland@npi.com Newsgroups: news.software.nn