sethostname: update doc
(too old to reply)
Bruno Haible
2017-04-22 13:00:46 UTC
Raw Message
On Mac OS X, I'm seeing this warning:

test-sethostname1.c:23:1: warning: incompatible pointer types initializing 'int (*)(const char *, size_t)' (aka 'int (*)(const char *, unsigned long)') with an expression of type 'int (const char *, int)' [-Wincompatible-pointer-types]
SIGNATURE_CHECK (sethostname, int, (const char *, size_t));
^ ~~~~~~~~~~~
./signature.h:39:3: note: expanded from macro 'SIGNATURE_CHECK'
SIGNATURE_CHECK1 (fn, ret, args, __LINE__)
^ ~~
./signature.h:44:3: note: expanded from macro 'SIGNATURE_CHECK1'
SIGNATURE_CHECK2 (fn, ret, args, id) /* macroexpand line */
^ ~~
./signature.h:46:28: note: expanded from macro 'SIGNATURE_CHECK2'
static ret (* _GL_UNUSED signature_check ## id) args = fn
^ ~~
<scratch space>:4:1: note: expanded from here

Here's a doc update:

2017-04-22 Bruno Haible <***@clisp.org>

sethostname: Update doc.
* doc/glibc-functions/sethostname.texi: Mention differing prototype on
Mac OS X.

diff --git a/doc/glibc-functions/sethostname.texi b/doc/glibc-functions/sethostname.texi
index b5afec8..ee05ab0 100644
--- a/doc/glibc-functions/sethostname.texi
+++ b/doc/glibc-functions/sethostname.texi
@@ -18,7 +18,9 @@ AIX 7.1, OSF/1 5.1, Solaris 10.
Portability problems not fixed by Gnulib:
-On Solaris 11 2010-11, the first argument is @code{char *} instead of
-@code{const char *} and the second parameter is @code{int} instead of
+The first parameter is @code{char *} instead of @code{const char *}
+on some platforms: Solaris 11 2010-11.
+The second parameter is @code{int} instead of @code{size_t}
+on some platforms: Mac OS X 10.12, Solaris 11 2010-11.
@end itemize