mirror of
https://sourceware.org/git/glibc.git
synced 2025-10-27 12:15:39 +03:00
Previously this file failed to compile with the following errors:
$ gcc manual/examples/inetcli.c
manual/examples/inetcli.c: In function ‘write_to_server’:
manual/examples/inetcli.c:36:37: error: implicit declaration of function ‘strlen’ [-Wimplicit-function-declaration]
36 | nbytes = write (filedes, MESSAGE, strlen (MESSAGE) + 1);
| ^~~~~~
manual/examples/inetcli.c:26:1: note: include ‘<string.h>’ or provide a declaration of ‘strlen’
25 | #include <netdb.h>
+++ |+#include <string.h>
26 |
manual/examples/inetcli.c:36:37: warning: incompatible implicit declaration of built-in function ‘strlen’ [-Wbuiltin-declaration-mismatch]
36 | nbytes = write (filedes, MESSAGE, strlen (MESSAGE) + 1);
| ^~~~~~
manual/examples/inetcli.c:36:37: note: include ‘<string.h>’ or provide a declaration of ‘strlen’
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
These are source files for example code that appears in The GNU C Library Reference Manual. While the manual itself is licensed under the terms of the GNU Free Documentation License, you can use these source files on their own under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License, or (at your option) any later version.