Article View: news.software.nntp
Article #29841Re: INN 2.0, can't build on OSF/1 V3.0
From: Matt Dillon
Date: Thu, 16 Jul 1998 00:00
Date: Thu, 16 Jul 1998 00:00
54 lines
3010 bytes
3010 bytes
:In article <1998Jul16.090320.1@eisner>, <BBOWLER@BIGELOW.ORG> wrote:
:>In article <1r67gyepds.fsf@haey.ifi.uio.no>, Kjetil Torgrim Homme <kjetilho@haey.ifi.uio.no> writes:
:>> [bowler@eisner.decus.org]
:>>
:>>> I'm trying to build Inn-2.0 on a DEC Alpha running V3.0 of OSF/1
:>>> (I know it's old but I'm stuck there...)
:....
:>>> > HASH Hash(const void *value, const size_t len) {
:>>> > -----^
:>>> >/usr/lib/cmplrs/cc/cfe: Error: hash.c, line 44: Incompatible type for the
:>>> >function parameter
:>>....
:>> HASH Hash(const void *value, size_t len);
:>>
:>> Note the missing "const"... Add that, and it should compile fine.
:>
:>Fixed... Thanks!
:>
:>Now for the next problem...
:>
:>There is a similar problem (mismatch between prototypes in the .h and actual
:>declarations in the source) with both cnfs and timehash in the storage
:>directory tree. Which is the "correct" definition, the prototype or the call
:>(I'm assuming the call is correct, but it would be nice to know for sure...)
:>
:>TIA (again)
:>Bruce
The way I handle this with all my source code is to have a 'Prototype'
line for function and variable exports in each source module. The
"defs.h" does a '#define Prototype extern'. The makefile then generates
a protos.h file by grep'ing out all the Prototype lines from the source
files, which defs.h includes at the end.
This way prototypes can be placed in the same source file as the function,
making the source code more modular. It also means I don't really have
to use 'static', which clutters things up and imposes code ordering
requirements that are backwards, yet still be able to tell which
functions are local to a module and which are not.
You can see this in action if you look at how the Diablo source is
structures (at http://www.backplane.com/diablo/ ). I started doing this
in my old Amiga programming days and never looked back. It allows me
to compile everything "-Wall -Wstrict-prototypes" and gives me a reasonable
assurance that everything is being compiled properly.
-Matt
--
Matthew Dillon Engineering, HiWay Technologies, Inc. & BEST Internet
Communications
<dillon@best.net> (Please include original email in any response)
Technical Details
Message-ID:
<6olpuf$hep$1@flea.best.net>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailReferences:
<1998Jul15.105220.1@eisner> <1r67gyepds.fsf@haey.ifi.uio.no> <1998Jul16.090320.1@eisner>Show Full Headers
Complete Article Headers
Message-ID: <6olpuf$hep$1@flea.best.net> Subject: Re: INN 2.0, can't build on OSF/1 V3.0 Date: Thu, 16 Jul 1998 00:00:00 +0000 From: dillon@best.net (Matt Dillon) References: <1998Jul15.105220.1@eisner> <1r67gyepds.fsf@haey.ifi.uio.no> <1998Jul16.090320.1@eisner> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 372149843 X-Trace: 900623121 11267 dillon 206.184.139.131 Organization: Best Internet Communications, Inc. Newsgroups: news.software.nntp