From 2dcf2dd217fa13da21d174c172900422a871dd84 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 | 4 +++- tests/test-gethostname.c | 4 +++- tests/test-getpeername.c | 4 +++- tests/test-getsockname.c | 4 +++- tests/test-getsockopt.c | 4 +++- tests/test-recvfrom.c | 7 ++++--- 13 files changed, 54 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3a1a13fcaf..9a518a6c45 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-23 Collin Funk uchar-h-c23: Fix compilation error on OmniOS. diff --git a/doc/posix-functions/accept.texi b/doc/posix-functions/accept.texi index 9ed5973ab1..052b78df44 100644 --- a/doc/posix-functions/accept.texi +++ b/doc/posix-functions/accept.texi @@ -32,5 +32,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 d162cea738..572b9cc0d8 100644 --- a/doc/posix-functions/gethostname.texi +++ b/doc/posix-functions/gethostname.texi @@ -22,7 +22,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 43ae10771c..bf998456fd 100644 --- a/doc/posix-functions/getpeername.texi +++ b/doc/posix-functions/getpeername.texi @@ -24,4 +24,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 e00034610e..68ea63abfc 100644 --- a/doc/posix-functions/getsockname.texi +++ b/doc/posix-functions/getsockname.texi @@ -24,4 +24,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 5ec2ad8c95..aa5a9dfe97 100644 --- a/doc/posix-functions/getsockopt.texi +++ b/doc/posix-functions/getsockopt.texi @@ -27,5 +27,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 096faa8b37..6aab46583a 100644 --- a/doc/posix-functions/recvfrom.texi +++ b/doc/posix-functions/recvfrom.texi @@ -24,4 +24,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 0252b3805b..2557d06e20 100644 --- a/tests/test-accept.c +++ b/tests/test-accept.c @@ -1,5 +1,5 @@ /* Test accepting a connection to a server socket. - Copyright (C) 2011-2024 Free Software Foundation, Inc. + Copyright (C) 2011-2025 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -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 d60cf206ae..c10bdc5370 100644 --- a/tests/test-gethostname.c +++ b/tests/test-gethostname.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2024 Free Software Foundation, Inc. + * Copyright (C) 2008-2025 Free Software Foundation, Inc. * Written by Simon Josefsson. * * This program is free software: you can redistribute it and/or modify @@ -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 4e3034410d..24db394f1e 100644 --- a/tests/test-getpeername.c +++ b/tests/test-getpeername.c @@ -1,5 +1,5 @@ /* Test getpeername() function. - Copyright (C) 2011-2024 Free Software Foundation, Inc. + Copyright (C) 2011-2025 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -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 add62cbc2d..b5ad73a5d2 100644 --- a/tests/test-getsockname.c +++ b/tests/test-getsockname.c @@ -1,5 +1,5 @@ /* Test getsockname() function. - Copyright (C) 2011-2024 Free Software Foundation, Inc. + Copyright (C) 2011-2025 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -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 93e55699cc..0a8254ca06 100644 --- a/tests/test-getsockopt.c +++ b/tests/test-getsockopt.c @@ -1,5 +1,5 @@ /* Test getsockopt() function. - Copyright (C) 2011-2024 Free Software Foundation, Inc. + Copyright (C) 2011-2025 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -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 56354611a0..8bb839d87b 100644 --- a/tests/test-recvfrom.c +++ b/tests/test-recvfrom.c @@ -1,5 +1,5 @@ /* Test the recvfrom() function. - Copyright (C) 2011-2024 Free Software Foundation, Inc. + Copyright (C) 2011-2025 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -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