[Top][All Lists]
[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: |
Sun, 26 Dec 2010 21:32:28 +0100 |
Hi Bruno
This seems to be indeed new and due to the new "#include <netdb.h>" which
doesn't agree with gnulib's arpa/inet.h
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 -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")
...
Same error in several tests.
Bye, Jojo
-----Original Message-----
From: Joachim Schmitz [mailto:address@hidden
Sent: Saturday, December 25, 2010 5:58 PM
To: 'Bruno Haible'
Cc: 'address@hidden'
Subject: RE: socket functions on HP-NonStop
This doesn't seem to be sufficient, I still (or now? Not sure) get errors for
inet_ntop() and accept():
argument of type "socklen_t *" is incompatible with parameter of
type "size_t *"
Bye, Jojo
-----Original Message-----
From: Bruno Haible [mailto:address@hidden
Sent: Friday, December 24, 2010 5:22 PM
To: Joachim Schmitz
Cc: address@hidden
Subject: Re: socket functions on HP-NonStop
Joachim Schmitz wrote:
> 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)
OK, I wanted to know whether socklen_t comes from NSK or from gnulib.
Since you say it comes from NSK, we cannot change it.
> 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
This is not good. Other libraries (in user programs) may use the socklen_t type
in their external API. gnulib cannot simply change it.
I'm committing a more relaxed handling of the declarations instead:
2010-12-24 Bruno Haible <address@hidden>
sys_socket: Hide mismatch of declarations on NonStop Kernel.
* lib/sys_socket.in.h (connect, bind, sendto, setsockopt): Use
_GL_CXXALIAS_SYS_CAST instead of _GL_CXXALIAS_SYS.
Reported by Joachim Schmitz <address@hidden>.
--- lib/sys_socket.in.h.orig Fri Dec 24 17:13:49 2010
+++ lib/sys_socket.in.h Fri Dec 24 17:12:57 2010
@@ -245,8 +245,11 @@
_GL_CXXALIAS_RPL (connect, int,
(int fd, const struct sockaddr *addr, socklen_t addrlen));
# else -_GL_CXXALIAS_SYS (connect, int,
- (int fd, const struct sockaddr *addr, socklen_t addrlen));
+/* Need to cast, because on NonStop Kernel, the third parameter is
+ size_t addrlen.
+*/ _GL_CXXALIAS_SYS_CAST (connect, int,
+ (int fd,
+ const struct sockaddr *addr, socklen_t
+addrlen));
# endif
_GL_CXXALIASWARN (connect);
#elif @HAVE_WINSOCK2_H@
@@ -300,8 +303,11 @@
_GL_CXXALIAS_RPL (bind, int,
(int fd, const struct sockaddr *addr, socklen_t addrlen));
# else -_GL_CXXALIAS_SYS (bind, int,
- (int fd, const struct sockaddr *addr, socklen_t addrlen));
+/* Need to cast, because on NonStop Kernel, the third parameter is
+ size_t addrlen.
+*/ _GL_CXXALIAS_SYS_CAST (bind, int,
+ (int fd,
+ const struct sockaddr *addr, socklen_t
+addrlen));
# endif
_GL_CXXALIASWARN (bind);
#elif @HAVE_WINSOCK2_H@
@@ -522,9 +528,11 @@
(int fd, const void *buf, size_t len, int flags,
const struct sockaddr *to, socklen_t tolen)); # else
-_GL_CXXALIAS_SYS (sendto, ssize_t,
- (int fd, const void *buf, size_t len, int flags,
- const struct sockaddr *to, socklen_t tolen));
+/* Need to cast, because on NonStop Kernel, the sixth parameter is
+ size_t tolen. */
+_GL_CXXALIAS_SYS_CAST (sendto, ssize_t,
+ (int fd, const void *buf, size_t len, int flags,
+ const struct sockaddr *to, socklen_t tolen));
# endif
_GL_CXXALIASWARN (sendto);
#elif @HAVE_WINSOCK2_H@
@@ -550,8 +558,11 @@
_GL_CXXALIAS_RPL (setsockopt, int, (int fd, int level, int optname,
const void * optval, socklen_t optlen));
# else -_GL_CXXALIAS_SYS (setsockopt, int, (int fd, int level, int optname,
- const void * optval, socklen_t optlen));
+/* Need to cast, because on NonStop Kernel, the fifth parameter is
+ size_t optlen. */
+_GL_CXXALIAS_SYS_CAST (setsockopt, int,
+ (int fd, int level, int optname,
+ const void * optval, socklen_t optlen));
# endif
_GL_CXXALIASWARN (setsockopt);
#elif @HAVE_WINSOCK2_H@
- Re: printf.o HP-NonStop, (continued)
- Re: socket functions on HP-NonStop, Bruno Haible, 2010/12/23
- RE: socket functions on HP-NonStop, Joachim Schmitz, 2010/12/23
- Re: socket functions on HP-NonStop, Bruno Haible, 2010/12/24
- RE: socket functions on HP-NonStop, Joachim Schmitz, 2010/12/25
- Re: socket functions on HP-NonStop, Bruno Haible, 2010/12/26
- RE: socket functions on HP-NonStop, Joachim Schmitz, 2010/12/27
- RE: socket functions on HP-NonStop,
Joachim Schmitz <=
- Re: socket functions on HP-NonStop, Bruno Haible, 2010/12/26
- RE: socket functions on HP-NonStop, Joachim Schmitz, 2010/12/27
- Re: socket functions on HP-NonStop, Bruno Haible, 2010/12/27