From 974b4446c4b8999d290de802d746025a038b1f05 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 24 Jan 2025 20:06:06 +0100 Subject: [PATCH] tests: Fix a few compilation errors on Solaris 11 OmniOS with gcc 14. * tests/test-accept.c: Omit the signature check on Solaris. * tests/test-gethostname.c: Likewise. * tests/test-getpeername.c: Likewise. * tests/test-getsockname.c: Likewise. * tests/test-getsockopt.c: Likewise. * tests/test-recvfrom.c: Likewise. * doc/posix-functions/accept.texi: Mention the Solaris 11 OmniOS problem. * doc/posix-functions/gethostname.texi: Likewise. * doc/posix-functions/getpeername.texi: Likewise. * doc/posix-functions/getsockname.texi: Likewise. * doc/posix-functions/getsockopt.texi: Likewise. * doc/posix-functions/recvfrom.texi: Likewise. --- ChangeLog | 17 +++++++++++++++++ doc/posix-functions/accept.texi | 2 +- doc/posix-functions/gethostname.texi | 2 +- doc/posix-functions/getpeername.texi | 4 ++++ doc/posix-functions/getsockname.texi | 4 ++++ doc/posix-functions/getsockopt.texi | 4 ++++ doc/posix-functions/recvfrom.texi | 4 ++++ tests/test-accept.c | 2 ++ tests/test-gethostname.c | 2 ++ tests/test-getpeername.c | 2 ++ tests/test-getsockname.c | 2 ++ tests/test-getsockopt.c | 2 ++ tests/test-recvfrom.c | 5 +++-- 13 files changed, 48 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3daf00751d..ea015f81ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2025-01-24 Bruno Haible + + tests: Fix a few compilation errors on Solaris 11 OmniOS with gcc 14. + * tests/test-accept.c: Omit the signature check on Solaris. + * tests/test-gethostname.c: Likewise. + * tests/test-getpeername.c: Likewise. + * tests/test-getsockname.c: Likewise. + * tests/test-getsockopt.c: Likewise. + * tests/test-recvfrom.c: Likewise. + * doc/posix-functions/accept.texi: Mention the Solaris 11 OmniOS + problem. + * doc/posix-functions/gethostname.texi: Likewise. + * doc/posix-functions/getpeername.texi: Likewise. + * doc/posix-functions/getsockname.texi: Likewise. + * doc/posix-functions/getsockopt.texi: Likewise. + * doc/posix-functions/recvfrom.texi: Likewise. + 2025-01-24 Bruno Haible sys_socket-h tests: Avoid compilation error on Solaris 11.4. diff --git a/doc/posix-functions/accept.texi b/doc/posix-functions/accept.texi index d89de215d1..61bcc7fd4f 100644 --- a/doc/posix-functions/accept.texi +++ b/doc/posix-functions/accept.texi @@ -38,5 +38,5 @@ third argument type is @samp{int *}. @item On some platforms, this function's third argument type is @samp{void *}, not @samp{socklen_t *}: -Solaris 10. +Solaris 10, Solaris 11 OmniOS. @end itemize diff --git a/doc/posix-functions/gethostname.texi b/doc/posix-functions/gethostname.texi index 73df5bd0bf..0c105e1c29 100644 --- a/doc/posix-functions/gethostname.texi +++ b/doc/posix-functions/gethostname.texi @@ -23,7 +23,7 @@ Portability problems not fixed by Gnulib: @item This function's second argument type is @code{int} instead of @code{size_t} on some platforms: -Solaris 10. +Solaris 10, Solaris 11 OmniOS. @item If the given buffer is too small for the host name, some implementations fail with @code{EINVAL}, instead of returning a truncated host name. diff --git a/doc/posix-functions/getpeername.texi b/doc/posix-functions/getpeername.texi index a53c059dd9..d9c8daa55f 100644 --- a/doc/posix-functions/getpeername.texi +++ b/doc/posix-functions/getpeername.texi @@ -30,4 +30,8 @@ Portability problems not fixed by Gnulib: @item Some platforms don't have a @code{socklen_t} type; in this case this function's third argument type is @samp{int *}. +@item +On some platforms, this function's third argument type is @samp{void *}, +not @samp{socklen_t *}: +Solaris 11 OmniOS. @end itemize diff --git a/doc/posix-functions/getsockname.texi b/doc/posix-functions/getsockname.texi index 1e6c3981a2..a254da1096 100644 --- a/doc/posix-functions/getsockname.texi +++ b/doc/posix-functions/getsockname.texi @@ -30,4 +30,8 @@ Portability problems not fixed by Gnulib: @item Some platforms don't have a @code{socklen_t} type; in this case this function's third argument type is @samp{int *}. +@item +On some platforms, this function's third argument type is @samp{void *}, +not @samp{socklen_t *}: +Solaris 11 OmniOS. @end itemize diff --git a/doc/posix-functions/getsockopt.texi b/doc/posix-functions/getsockopt.texi index 41af61beee..8835303d1f 100644 --- a/doc/posix-functions/getsockopt.texi +++ b/doc/posix-functions/getsockopt.texi @@ -33,5 +33,9 @@ Portability problems not fixed by Gnulib: Some platforms don't have a @code{socklen_t} type; in this case this function's fifth argument type is @samp{int *}. @item +On some platforms, this function's fifth argument type is @samp{void *}, +not @samp{socklen_t *}: +Solaris 11 OmniOS. +@item Many socket options are not available on all platforms. @end itemize diff --git a/doc/posix-functions/recvfrom.texi b/doc/posix-functions/recvfrom.texi index 6edddbebdb..5ca7b525e7 100644 --- a/doc/posix-functions/recvfrom.texi +++ b/doc/posix-functions/recvfrom.texi @@ -30,4 +30,8 @@ Portability problems not fixed by Gnulib: @item Some platforms don't have a @code{socklen_t} type; in this case this function's sixth argument type is @samp{int *}. +@item +On some platforms, this function's sixth argument type is @samp{void *}, +not @samp{socklen_t *}: +Solaris 11 OmniOS. @end itemize diff --git a/tests/test-accept.c b/tests/test-accept.c index 01cb1984d8..2557d06e20 100644 --- a/tests/test-accept.c +++ b/tests/test-accept.c @@ -19,7 +19,9 @@ #include #include "signature.h" +#if !defined __sun SIGNATURE_CHECK (accept, int, (int, struct sockaddr *, socklen_t *)); +#endif #include #include diff --git a/tests/test-gethostname.c b/tests/test-gethostname.c index f1822deb73..c10bdc5370 100644 --- a/tests/test-gethostname.c +++ b/tests/test-gethostname.c @@ -21,7 +21,9 @@ #include #include "signature.h" +#if !defined __sun SIGNATURE_CHECK (gethostname, int, (char *, size_t)); +#endif /* Get HOST_NAME_MAX definition. */ #include diff --git a/tests/test-getpeername.c b/tests/test-getpeername.c index 97d4a57785..24db394f1e 100644 --- a/tests/test-getpeername.c +++ b/tests/test-getpeername.c @@ -19,7 +19,9 @@ #include #include "signature.h" +#if !defined __sun SIGNATURE_CHECK (getpeername, int, (int, struct sockaddr *, socklen_t *)); +#endif #include #include diff --git a/tests/test-getsockname.c b/tests/test-getsockname.c index 9c75a43ce2..b5ad73a5d2 100644 --- a/tests/test-getsockname.c +++ b/tests/test-getsockname.c @@ -19,7 +19,9 @@ #include #include "signature.h" +#if !defined __sun SIGNATURE_CHECK (getsockname, int, (int, struct sockaddr *, socklen_t *)); +#endif #include #include diff --git a/tests/test-getsockopt.c b/tests/test-getsockopt.c index 34698fd9db..0a8254ca06 100644 --- a/tests/test-getsockopt.c +++ b/tests/test-getsockopt.c @@ -19,7 +19,9 @@ #include #include "signature.h" +#if !defined __sun SIGNATURE_CHECK (getsockopt, int, (int, int, int, void *, socklen_t *)); +#endif #include #include diff --git a/tests/test-recvfrom.c b/tests/test-recvfrom.c index ccf606cba4..8bb839d87b 100644 --- a/tests/test-recvfrom.c +++ b/tests/test-recvfrom.c @@ -19,9 +19,10 @@ #include #include "signature.h" +#if !defined __sun SIGNATURE_CHECK (recvfrom, ssize_t, - (int, void *, size_t, int, - struct sockaddr *, socklen_t *)); + (int, void *, size_t, int, struct sockaddr *, socklen_t *)); +#endif #include #include -- 2.39.5