ht://Dig 3.0.8b2 - compilation error under AIX 4.2.1


Kevin Broadey (kevin.broadey@ats.uk.eds.com)
Tue, 16 Jun 1998 13:33:58 +0100


Hi Andrew,

ht://Dig 3.0.8b2 failed to compile on my RS/6000 running AIX 4.2.1.0 using gcc-2.8.1/libg++2.8.1.1a.  The relevant part of the compilation log is:-

cd /scratch/kevinb/build/htdig-3.0.8b2/htlib/
gmake CXX="c++ -w"
c++ -w -c -g -O  -DDEFAULT_CONFIG_FILE=\"/usr/local/htdig/conf/htdig.conf\" -I../htlib -I../htcommon -I../include -I../gdbm-1.7.3 -I../rx-1.5/rx Connection.cc
Connection.cc: In method `char * Connection::get_peerip()':
Connection.cc:472: passing `int *' as argument 3 of `getpeername(int, sockaddr *, long unsigned int *)'
gmake: *** [Connection.o] Error 1

Compilation exited abnormally with code 2 at Tue Jun 16 13:03:29

Looking through the code you've got #ifdef _AIX before most of the calls to getpeername(), but you missed one in get_peerip().  Here's a patch to fix it.
crabby /htlib $ gdiff -u Connection-orig.cc Connection.cc
--- Connection-orig.cc Fri Aug 15 06:59:35 1997
+++ Connection.cc Tue Jun 16 13:25:20 1998
@@ -464,7 +464,7 @@
 {
     struct sockaddr_in peer;
 #ifdef _AIX
-    int   length = sizeof(peer);
+    size_t  length = sizeof(peer);
 #else
     int   length = sizeof(peer);
 #endif
crabby /htlib $
BTW There are an awful lot of warnings coming out of the compilation process.  I had to re-run with CXX="c++ -w" before I could spot where the problem was.

--
Kevin Broadey, Software Development Manager,    _/_/_/ _/_/_/    _/_/
EDS Ltd, 7 Bartley Heath Business Park,        _/     _/    _/ _/
Bartley Way, Hook, Hants, RG27 9XA, England.  _/_/   _/    _/   _/
Tel: +44 1256 748889  Fax: +44 1256 748781   _/     _/    _/     _/
mailto:kevin.broadey@ats.uk.eds.com         _/_/_/ _/_/_/    _/_/
 



This archive was generated by hypermail 2.0b3 on Sat Jan 02 1999 - 16:26:33 PST