bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: socket functions on HP-NonStop


From: Joachim Schmitz
Subject: RE: socket functions on HP-NonStop
Date: Thu, 23 Dec 2010 15:18:09 +0100

Libfloss is not used (yet?), but has some hooks for this problem, the compiler 
wrapper script it contains uses -DSOCKLEN_T=socklen_t.

Other than that socklen_t is typedef'ed in <sys/socket.h> (and as an int) but, 
for some strange and probably historical reason, not used anywhere, in 
particular not in those socket funktions with use a size_t instead (which is 
typedefe'ed to an unsigned integer)

My 'fix' so far:
diff -u ./gllib/sys_socket.in.h.orig ./gllib/sys_socket.in.h
--- ./gllib/sys_socket.in.h.orig        2010-11-30 14:19:12.000000000 -0600
+++ ./gllib/sys_socket.in.h     2010-12-23 04:43:53.000000000 -0600
@@ -165,6 +165,10 @@

 #endif

+#ifdef __TANDEM
+#define socklen_t size_t
+#endif
+
 #if @HAVE_WINSOCK2_H@

 /* Re-define FD_ISSET to avoid a WSA call while we are not using

-----Original Message-----
From: Bruno Haible [mailto:address@hidden 
Sent: Thursday, December 23, 2010 3:05 PM
To: Joachim Schmitz
Cc: address@hidden
Subject: Re: socket functions on HP-NonStop

Joachim Schmitz wrote:
> Incompatible prototype for inet_ntop
> source='test-getaddrinfo.c' object='test-getaddrinfo.o' libtool=no  
> DEPDIR=.deps depmode=none /bin/sh ./../build-aux/depcomp  cc 
> -DHAVE_CONFIG_H -I.  -DGNULIB_STRICT_CHECKING=1  -I. -I.  -I.. -I./..  
> -I../gllib -I./../gllib  -I/usr/local/include  -g -Wnowarn -c -o 
> test-getaddrinfo.o test-getaddrinfo.c
>   extern const char *inet_ntop (int af, const void *restrict src,
>                      ^
> "/usr/local/Floss/gnulib/testdir-posix/gltests/./../gllib/arpa/inet.h", line 
> 129: error(235):
>           declaration is incompatible with
>           "const char *inet_ntop(int, const void *, char *, size_t)" 
> (declared
>           at line 421 of "/usr/include/netdb.h")
> 
> and connect, bind, sendto, setsockopt (socklen_t vs. size_t), 'fixed' 
> it in gllib/sys_socket.in.h (brute force, "#define socklen_t size_t") 
> source='test-sys_select-c++.cc' object='test-sys_select-c++.o' 
> libtool=no  DEPDIR=.deps depmode=none /bin/sh ./../build-aux/depcomp  
> c++ -DHAVE_CONFIG_H -I.   -DGNULIB_STRICT_CHECKING=1  -I. -I.  -I.. 
> -I./..  -I../gllib -I./../gllib -I/usr/local/include  -Wnowarn -c -o 
> test-sys_select-c++.o test-sys_select-c++.cc
>   _GL_CXXALIAS_SYS (connect, int,
>   ^
> "/usr/local/Floss/gnulib/testdir-posix/gltests/../gllib/sys/socket.h", line 
> 560: error(232):
>           a value of type "extern "C" int (*)(int, const sockaddr *, size_t)"
>           cannot be used to initialize an entity of type
>           "int (*)(int, const sockaddr *, socklen_t)"
> 
>   _GL_CXXALIAS_SYS (bind, int,
>   ^
> "/usr/local/Floss/gnulib/testdir-posix/gltests/../gllib/sys/socket.h", line 
> 615: error(232):
>           a value of type "extern "C" int (*)(int, const sockaddr *, size_t)"
>           cannot be used to initialize an entity of type
>           "int (*)(int, const sockaddr *, socklen_t)"
> 
>   _GL_CXXALIAS_SYS (sendto, ssize_t,
>   ^
> "/usr/local/Floss/gnulib/testdir-posix/gltests/../gllib/sys/socket.h", line 
> 837: error(232):
>           a value of type "extern "C" ssize_t (*)(int, const void *, 
> size_t,
>           int, const sockaddr *, size_t)" cannot be used to initialize 
> an
>           entity of type "ssize_t (*)(int, const void *, size_t, int, 
> const
>           sockaddr *, socklen_t)"
> 
>   _GL_CXXALIAS_SYS (setsockopt, int, (int fd, int level, int optname,
>   ^
> "/usr/local/Floss/gnulib/testdir-posix/gltests/../gllib/sys/socket.h", line 
> 865: error(232):
>           a value of type
>           "extern "C" int (*)(int, int, int, const void *, size_t)" 
> cannot be
>           used to initialize an entity of type
>           "int (*)(int, int, int, const void *, socklen_t)"

Is socklen_t already defined in the system or libfloss includes on this system?
Or does its definition come from gnulib (either from config.h or gnulib's 
sys/socket.h replacement)?

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]