public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/zack/no-nested-includes] fixup for sys/un.h: don't include string.h
@ 2019-05-26 16:37 Zack Weinberg
0 siblings, 0 replies; 2+ messages in thread
From: Zack Weinberg @ 2019-05-26 16:37 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=efb7444b0f8a0277dafb49d06c9d1c231418d041
commit efb7444b0f8a0277dafb49d06c9d1c231418d041
Author: Zack Weinberg <zackw@panix.com>
Date: Sun May 26 11:02:27 2019 -0400
fixup for sys/un.h: don't include string.h
1) For a valid prototype of strlen, sys/un.h must define size_t.
2) Some old RPC code was relying on sys/un.h to provide all of string.h.
* socket/sys/un.h: Include stddef.h for size_t.
* nis/nis_domain_of.c, nis/yp_xdr.c, sunrpc/svc.c: Include string.h.
Diff:
---
nis/nis_domain_of.c | 1 +
nis/yp_xdr.c | 1 +
socket/sys/un.h | 3 +++
sunrpc/svc.c | 1 +
4 files changed, 6 insertions(+)
diff --git a/nis/nis_domain_of.c b/nis/nis_domain_of.c
index 44c5b04..da26df3 100644
--- a/nis/nis_domain_of.c
+++ b/nis/nis_domain_of.c
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <rpcsvc/nis.h>
+#include <string.h>
#include <shlib-compat.h>
nis_name
diff --git a/nis/yp_xdr.c b/nis/yp_xdr.c
index 3b57673..4c9f1d2 100644
--- a/nis/yp_xdr.c
+++ b/nis/yp_xdr.c
@@ -31,6 +31,7 @@
#include <rpcsvc/yp.h>
#include <rpcsvc/ypclnt.h>
+#include <string.h>
#include <shlib-compat.h>
/* The NIS v2 protocol suggests 1024 bytes as a maximum length of all fields.
diff --git a/socket/sys/un.h b/socket/sys/un.h
index 8097436..104d28f 100644
--- a/socket/sys/un.h
+++ b/socket/sys/un.h
@@ -34,6 +34,9 @@ struct sockaddr_un
#ifdef __USE_MISC
+#define __need_size_t
+#include <stddef.h>
+
extern size_t strlen (const char *__s)
__THROW __attribute_pure__ __nonnull ((1));
diff --git a/sunrpc/svc.c b/sunrpc/svc.c
index 95ecfbb..8042019 100644
--- a/sunrpc/svc.c
+++ b/sunrpc/svc.c
@@ -53,6 +53,7 @@
*/
#include <errno.h>
+#include <string.h>
#include <unistd.h>
#include <rpc/rpc.h>
#include <rpc/svc.h>
^ permalink raw reply [flat|nested] 2+ messages in thread
* [glibc/zack/no-nested-includes] fixup for sys/un.h: don't include string.h
@ 2019-06-18 15:34 Zack Weinberg
0 siblings, 0 replies; 2+ messages in thread
From: Zack Weinberg @ 2019-06-18 15:34 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c52e60d2d7fd286c65d76c67eec04ae6e37775b1
commit c52e60d2d7fd286c65d76c67eec04ae6e37775b1
Author: Zack Weinberg <zackw@panix.com>
Date: Sun May 26 11:02:27 2019 -0400
fixup for sys/un.h: don't include string.h
1) For a valid prototype of strlen, sys/un.h must define size_t.
2) Some old RPC code was relying on sys/un.h to provide all of string.h.
* socket/sys/un.h: Include stddef.h for size_t.
* nis/nis_domain_of.c, nis/yp_xdr.c, sunrpc/svc.c: Include string.h.
Diff:
---
nis/nis_domain_of.c | 1 +
nis/yp_xdr.c | 1 +
socket/sys/un.h | 3 +++
sunrpc/svc.c | 1 +
4 files changed, 6 insertions(+)
diff --git a/nis/nis_domain_of.c b/nis/nis_domain_of.c
index 44c5b04..da26df3 100644
--- a/nis/nis_domain_of.c
+++ b/nis/nis_domain_of.c
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <rpcsvc/nis.h>
+#include <string.h>
#include <shlib-compat.h>
nis_name
diff --git a/nis/yp_xdr.c b/nis/yp_xdr.c
index 3b57673..4c9f1d2 100644
--- a/nis/yp_xdr.c
+++ b/nis/yp_xdr.c
@@ -31,6 +31,7 @@
#include <rpcsvc/yp.h>
#include <rpcsvc/ypclnt.h>
+#include <string.h>
#include <shlib-compat.h>
/* The NIS v2 protocol suggests 1024 bytes as a maximum length of all fields.
diff --git a/socket/sys/un.h b/socket/sys/un.h
index 8097436..104d28f 100644
--- a/socket/sys/un.h
+++ b/socket/sys/un.h
@@ -34,6 +34,9 @@ struct sockaddr_un
#ifdef __USE_MISC
+#define __need_size_t
+#include <stddef.h>
+
extern size_t strlen (const char *__s)
__THROW __attribute_pure__ __nonnull ((1));
diff --git a/sunrpc/svc.c b/sunrpc/svc.c
index 95ecfbb..8042019 100644
--- a/sunrpc/svc.c
+++ b/sunrpc/svc.c
@@ -53,6 +53,7 @@
*/
#include <errno.h>
+#include <string.h>
#include <unistd.h>
#include <rpc/rpc.h>
#include <rpc/svc.h>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-06-18 15:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-26 16:37 [glibc/zack/no-nested-includes] fixup for sys/un.h: don't include string.h Zack Weinberg
2019-06-18 15:34 Zack Weinberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).