pselect: Fix compilation error in C++ mode on AIX 7.
authorBruno Haible <bruno@clisp.org>
Sun, 26 Dec 2021 11:46:40 +0000 (12:46 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 26 Dec 2021 11:57:36 +0000 (12:57 +0100)
* lib/sys_select.in.h (pselect): Use _GL_CXXALIAS_SYS_CAST instead of
_GL_CXXALIAS_SYS.
* doc/posix-functions/pselect.texi: Mention the AIX problem.

ChangeLog
doc/posix-functions/pselect.texi
lib/sys_select.in.h

index 54b3a3548ff21a44e884eedec29373dbdf27a8e4..153e36296d17776aa13d68a505b6fa46d14af663 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2021-12-26  Bruno Haible  <bruno@clisp.org>
+
+       pselect: Fix compilation error in C++ mode on AIX 7.
+       * lib/sys_select.in.h (pselect): Use _GL_CXXALIAS_SYS_CAST instead of
+       _GL_CXXALIAS_SYS.
+       * doc/posix-functions/pselect.texi: Mention the AIX problem.
+
 2021-12-25  Bruno Haible  <bruno@clisp.org>
 
        gnulib-tool: Fix handling of module libtextstyle-optional.
index ce26c1688a27177b7118f51f29f8557959f9951b..83323e5c5e7a76f143008880674fd709715fb49a 100644 (file)
@@ -20,6 +20,9 @@ FreeBSD 8.2.
 Portability problems not fixed by Gnulib:
 @itemize
 @item
+This function has a slightly incompatible declaration on some platforms:
+AIX 7.1 (when @code{_ALL_SOURCE} is defined).
+@item
 When the @var{sigmask} argument is nonnull on platforms that do not
 natively support this function, race conditions are possible when its
 gnulib implementation temporarily modifies the signal mask, and the
index 910bea5d12aa7fd135918ca4a4e48084b0181359..e95e7e77c87e1359d2cfd5679962318dd08b2c20 100644 (file)
@@ -279,9 +279,13 @@ _GL_FUNCDECL_SYS (pselect, int,
                   (int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
                    struct timespec const *restrict, const sigset_t *restrict));
 #  endif
-_GL_CXXALIAS_SYS (pselect, int,
-                  (int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
-                   struct timespec const *restrict, const sigset_t *restrict));
+/* Need to cast, because on AIX 7, the second, third, fourth argument may be
+                        void *restrict,   void *restrict,   void *restrict.  */
+_GL_CXXALIAS_SYS_CAST (pselect, int,
+                       (int,
+                        fd_set *restrict, fd_set *restrict, fd_set *restrict,
+                        struct timespec const *restrict,
+                        const sigset_t *restrict));
 # endif
 _GL_CXXALIASWARN (pselect);
 #elif defined GNULIB_POSIXCHECK