]> git.ipfire.org Git - thirdparty/glibc.git/commit
Limit the set of strings.h functions also exposed in string.h.
authorZack Weinberg <zackw@panix.com>
Sun, 17 Mar 2019 01:01:12 +0000 (21:01 -0400)
committerZack Weinberg <zackw@panix.com>
Wed, 8 Jan 2020 18:42:38 +0000 (13:42 -0500)
commit7e2c24ffcbb36f4c568da4d7c6b31f89b21613ab
tree27ce22d6673b694724784a8d2c120b9ebbc9d836
parentee57733099e3d12bc0a822a2d56f4e5b1b2cdae1
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.
20 files changed:
NEWS
debug/tst-chk1.c
include/bits/strings_x2k8.h [new file with mode: 0644]
scripts/check-obsolete-constructs.py
string/Makefile
string/bits/strings_x2k8.h [new file with mode: 0644]
string/string.h
string/strings.h
string/test-string.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