Re: [xml] Compile error libxml2-2.1.1/Solaris

Date view Thread view Subject view Author view

From: Daniel Veillard (Daniel.Veillard@w3.org)
Date: Wed Jul 05 2000 - 10:21:11 EDT


On Mon, Jul 03, 2000 at 07:55:51PM +0100, Paul Barnfather wrote:
>
> Compilation fails with:
>
> /usr/local/bin/gcc -DHAVE_CONFIG_H -I. -I. -I. -I. -O2 -msupersparc -c
> nanohttp.c -fPIC -DPIC -o .libs/nanohttp.lo
> nanohttp.c: In function `xmlNanoHTTPConnectAttempt':
> nanohttp.c:659: `socklen_t' undeclared (first use in this function)
> nanohttp.c:659: (Each undeclared identifier is reported only once
> nanohttp.c:659: for each function it appears in.)
> nanohttp.c:659: parse error before `len'
> nanohttp.c:660: `len' undeclared (first use in this function)
> nanohttp.c:661: warning: passing arg 4 of `getsockopt' from incompatible pointer
> type
> make[2]: *** [nanohttp.lo] Error 1
> make[2]: Leaving directory `/src/build/libxml2-2.1.1'
>
> Using gcc-2.95.2/Solaris 2.6.
> Did autoconf miss a library out?

Steffen Zahn <Steffen.Zahn@icn.siemens.de> reported the same problem
and indicated a temporary fix:
:I fixed it by using size_t instead of socklen_t. The correct
:solution is probably to detect the existence of socklen_t with configure.

  I recompiled un a sun enterprise with Solaris-2.7 and an old
gcc version egcs-2.91.60 19981201 (egcs-1.1.1 release) without
problem.
  To try to find the problem I recompiled with cc of the SunPro
packages, and cleaned up a lot of things in the process but this
specific error didn't appear either ...
  It's sole use is as the last argument of getsockopt(), it seems
on bsd it uses int, linux uses socklen_t and Microsoft uses int ...
 http://msdn.microsoft.com/library/psdk/winsock/wsapiref_8qcy.htm

  The OpenGroup specify it uses socklen_t and this should be defined
in sys/socket.h:
 http://www.opennc.org/onlinepubs/7908799/xns/getsockopt.html

but warn about the fact that it should stay a small number:
 http://www.opennc.org/onlinepubs/7908799/xns/syssocket.h.html

 <sys/socket.h> makes available a type, socklen_t, which is an
 unsigned opaque integral type of length of at least 32 bits. To
 forestall portability problems, it is recommended that applications
 should not use values larger than 232 - 1.

  So I have switched back to use a simple int. All this is commited
in libxml W3C CVS base, and will propagate to future versions.

Daniel

-- 
Daniel.Veillard@w3.org | W3C, INRIA Rhone-Alpes  | Today's Bookmarks :
Tel : +33 476 615 257  | 655, avenue de l'Europe | Linux XML libxml WWW
Fax : +33 476 615 207  | 38330 Montbonnot FRANCE | Gnome rpm2html rpmfind
 http://www.w3.org/People/all#veillard%40w3.org  | RPM badminton Kaffe
----
Message from the list xml@xmlsoft.org
Archived at : http://xmlsoft.org/messages/
to unsubscribe: echo "unsubscribe xml" | mail  majordomo@xmlsoft.org


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Aug 02 2000 - 12:30:19 EDT