summaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorZack Weinberg <zackw@panix.com>2019-03-16 21:01:12 -0400
committerZack Weinberg <zackw@panix.com>2020-01-08 13:42:38 -0500
commit7e2c24ffcbb36f4c568da4d7c6b31f89b21613ab (patch)
tree27ce22d6673b694724784a8d2c120b9ebbc9d836 /sysdeps
parentee57733099e3d12bc0a822a2d56f4e5b1b2cdae1 (diff)
downloadglibc-7e2c24ffcbb36f4c568da4d7c6b31f89b21613ab.tar.gz
Limit the set of strings.h functions also exposed in string.h.
As someone who can remember when you might not be able to include both string.h and strings.h at the same time, it annoys me that strings.h still exists and is the only standard source for str(n)casecmp(_l) and ffs. I think it’s right that we expose those functions from string.h. However, there’s no reason we need to keep exposing the other obsolete functions that strings.h declares from string.h. This patch creates <bits/strings_x2k8.h>, which declares the non-obsolete functions whose official home is strings.h. strings.h includes it unconditionally, and string.h includes it under __USE_MISC, instead of strings.h. Two tests of the obsolete strings.h functions had to be adjusted. * string/strings.h (strcasecmp, strncasecmp, strcasecmp_l) (strncasecmp_l, ffs, ffsl, ffsll): Move declarations to... * string/bits/strings_x2k8.h: ... this new file. * string/Makefile: Install bits/strings_x2k8.h. * include/bits/strings_x2k8h: New wrapper. * string/string.h: Include bits/strings_x2k8.h instead of strings.h. * debug/tst-chk1.c, string/test-string.h: Include strings.h. * scripts/check-obsolete-constructs.py: string.h is no longer expected to include strings.h. * sysdeps/i386/i686/multiarch/bcopy.c * sysdeps/i386/i686/multiarch/bzero.c * sysdeps/i386/i686/multiarch/ifunc-impl-list.c * sysdeps/powerpc/powerpc32/power4/multiarch/ifunc-impl-list.c * sysdeps/powerpc/powerpc64/multiarch/bcopy-ppc64.c * sysdeps/powerpc/powerpc64/multiarch/bcopy.c * sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c * sysdeps/s390/bzero.c * sysdeps/s390/multiarch/ifunc-impl-list.c * sysdeps/sparc/sparc64/multiarch/bzero.c * sysdeps/sparc/sparc64/multiarch/ifunc-impl-list.c: Include strings.h.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/i386/i686/multiarch/bcopy.c1
-rw-r--r--sysdeps/i386/i686/multiarch/bzero.c1
-rw-r--r--sysdeps/i386/i686/multiarch/ifunc-impl-list.c1
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/ifunc-impl-list.c1
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/bcopy-ppc64.c1
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/bcopy.c1
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c1
-rw-r--r--sysdeps/s390/bzero.c1
-rw-r--r--sysdeps/s390/multiarch/ifunc-impl-list.c1
-rw-r--r--sysdeps/sparc/sparc64/multiarch/bzero.c1
-rw-r--r--sysdeps/sparc/sparc64/multiarch/ifunc-impl-list.c1
11 files changed, 11 insertions, 0 deletions
diff --git a/sysdeps/i386/i686/multiarch/bcopy.c b/sysdeps/i386/i686/multiarch/bcopy.c
index 2145ab7e69..929dc70321 100644
--- a/sysdeps/i386/i686/multiarch/bcopy.c
+++ b/sysdeps/i386/i686/multiarch/bcopy.c
@@ -21,6 +21,7 @@
#if IS_IN (libc)
# define bcopy __redirect_bcopy
# include <string.h>
+# include <strings.h>
# undef bcopy
# define SYMBOL_NAME bcopy
diff --git a/sysdeps/i386/i686/multiarch/bzero.c b/sysdeps/i386/i686/multiarch/bzero.c
index 3b68e1c113..3655262f1b 100644
--- a/sysdeps/i386/i686/multiarch/bzero.c
+++ b/sysdeps/i386/i686/multiarch/bzero.c
@@ -21,6 +21,7 @@
#if IS_IN (libc)
# define bzero __redirect_bzero
# include <string.h>
+# include <strings.h>
# undef bzero
# define SYMBOL_NAME bzero
diff --git a/sysdeps/i386/i686/multiarch/ifunc-impl-list.c b/sysdeps/i386/i686/multiarch/ifunc-impl-list.c
index 23774fbe8a..8101c0a2db 100644
--- a/sysdeps/i386/i686/multiarch/ifunc-impl-list.c
+++ b/sysdeps/i386/i686/multiarch/ifunc-impl-list.c
@@ -18,6 +18,7 @@
#include <assert.h>
#include <string.h>
+#include <strings.h>
#include <wchar.h>
#include <ifunc-impl-list.h>
#include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc32/power4/multiarch/ifunc-impl-list.c
index fca6c2cbef..07de0a96ab 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/ifunc-impl-list.c
@@ -18,6 +18,7 @@
#include <assert.h>
#include <string.h>
+#include <strings.h>
#include <wchar.h>
#include <ldsodefs.h>
#include <ifunc-impl-list.h>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/bcopy-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/bcopy-ppc64.c
index 0851afa313..4b530cdb6d 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/bcopy-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/bcopy-ppc64.c
@@ -17,6 +17,7 @@
<https://www.gnu.org/licenses/>. */
#include <string.h>
+#include <strings.h>
extern __typeof (bcopy) __bcopy_ppc attribute_hidden;
extern __typeof (memmove) __memmove_ppc attribute_hidden;
diff --git a/sysdeps/powerpc/powerpc64/multiarch/bcopy.c b/sysdeps/powerpc/powerpc64/multiarch/bcopy.c
index 2aebfc0a8e..1a7c9099d9 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/bcopy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/bcopy.c
@@ -17,6 +17,7 @@
<https://www.gnu.org/licenses/>. */
#include <string.h>
+#include <strings.h>
#include "init-arch.h"
extern __typeof (bcopy) __bcopy_ppc attribute_hidden;
diff --git a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
index b9fef3f43c..41d133051d 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
@@ -18,6 +18,7 @@
#include <assert.h>
#include <string.h>
+#include <strings.h>
#include <wchar.h>
#include <ldsodefs.h>
#include <ifunc-impl-list.h>
diff --git a/sysdeps/s390/bzero.c b/sysdeps/s390/bzero.c
index fc0d46e2e1..fc641e12fc 100644
--- a/sysdeps/s390/bzero.c
+++ b/sysdeps/s390/bzero.c
@@ -19,6 +19,7 @@
#include <ifunc-memset.h>
#if HAVE_MEMSET_IFUNC
# include <string.h>
+# include <strings.h>
# include <ifunc-resolve.h>
# if HAVE_MEMSET_Z900_G5
diff --git a/sysdeps/s390/multiarch/ifunc-impl-list.c b/sysdeps/s390/multiarch/ifunc-impl-list.c
index e6195c6e26..0d94949145 100644
--- a/sysdeps/s390/multiarch/ifunc-impl-list.c
+++ b/sysdeps/s390/multiarch/ifunc-impl-list.c
@@ -18,6 +18,7 @@
#include <assert.h>
#include <string.h>
+#include <strings.h>
#include <wchar.h>
#include <ifunc-impl-list.h>
#include <ifunc-resolve.h>
diff --git a/sysdeps/sparc/sparc64/multiarch/bzero.c b/sysdeps/sparc/sparc64/multiarch/bzero.c
index ee501502aa..fc7af26d84 100644
--- a/sysdeps/sparc/sparc64/multiarch/bzero.c
+++ b/sysdeps/sparc/sparc64/multiarch/bzero.c
@@ -20,6 +20,7 @@
#if IS_IN (libc)
# define bzero __redirect_bzero
# include <string.h>
+# include <strings.h>
# undef bzero
# include <sparc-ifunc.h>
diff --git a/sysdeps/sparc/sparc64/multiarch/ifunc-impl-list.c b/sysdeps/sparc/sparc64/multiarch/ifunc-impl-list.c
index ad79a26169..2fa7a3a9ef 100644
--- a/sysdeps/sparc/sparc64/multiarch/ifunc-impl-list.c
+++ b/sysdeps/sparc/sparc64/multiarch/ifunc-impl-list.c
@@ -18,6 +18,7 @@
#include <assert.h>
#include <string.h>
+#include <strings.h>
#include <wchar.h>
#include <ldsodefs.h>
#include <sysdep.h>