1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-06-03 13:22:05 +03:00

Fix fnmatch wmemchr namespace (bug 18468).

fnmatch brings in references to wmemchr, which isn't in all the
standards that contain fnmatch, resulting in linknamespace test
failures.  This patch fixes this in the usual way, making wmemchr into
a weak alias for __wmemchr.

Tested for x86_64 and x86 (testsuite, and that disassembly of
installed shared libraries is unchanged by the patch).

	[BZ #18468]
	* wcsmbs/wmemchr.c (wmemchr): Rename to __wmemchr and define as
	weak alias of __wmemchr.  Use libc_hidden_weak.
	* include/wchar.h (__wmemchr): Declare.  Use libc_hidden_proto.
	* posix/fnmatch.c [HANDLE_MULTIBYTE] (MEMCHR): Use __wmemchr
	instead of wmemchr.
This commit is contained in:
Joseph Myers 2015-06-03 13:57:40 +00:00
parent 1a1a6bde63
commit aca6ea6586
5 changed files with 19 additions and 5 deletions

View File

@ -1,3 +1,12 @@
2015-06-03 Joseph Myers <joseph@codesourcery.com>
[BZ #18468]
* wcsmbs/wmemchr.c (wmemchr): Rename to __wmemchr and define as
weak alias of __wmemchr. Use libc_hidden_weak.
* include/wchar.h (__wmemchr): Declare. Use libc_hidden_proto.
* posix/fnmatch.c [HANDLE_MULTIBYTE] (MEMCHR): Use __wmemchr
instead of wmemchr.
2015-06-02 Roland McGrath <roland@hack.frob.com>
[BZ #18383]

2
NEWS
View File

@ -19,7 +19,7 @@ Version 2.22
18047, 18049, 18068, 18080, 18093, 18100, 18104, 18110, 18111, 18116,
18125, 18128, 18138, 18185, 18196, 18197, 18206, 18210, 18211, 18217,
18220, 18221, 18234, 18244, 18247, 18287, 18319, 18333, 18346, 18397,
18409, 18410, 18412, 18418, 18422, 18434, 18444, 18469.
18409, 18410, 18412, 18418, 18422, 18434, 18444, 18468, 18469.
* Cache information can be queried via sysconf() function on s390 e.g. with
_SC_LEVEL1_ICACHE_SIZE as argument.

View File

@ -87,7 +87,7 @@ libc_hidden_proto (wcsspn)
libc_hidden_proto (wcschr)
/* The C++ overloading of wcschr means we have to repeat the type to
declare __wcschr instead of using typeof, to avoid errors in C++
tests. */
tests. The same applies to __wmemchr. */
extern wchar_t *__wcschr (const wchar_t *__wcs, wchar_t __wc)
__THROW __attribute_pure__;
libc_hidden_proto (__wcschr)
@ -95,7 +95,10 @@ libc_hidden_proto (wcscoll)
libc_hidden_proto (wcspbrk)
extern typeof (wmemset) __wmemset;
extern wchar_t *__wmemchr (const wchar_t *__s, wchar_t __c, size_t __n)
__THROW __attribute_pure__;
libc_hidden_proto (wmemchr)
libc_hidden_proto (__wmemchr)
libc_hidden_proto (wmemset)
libc_hidden_proto (__wmemset)

View File

@ -245,7 +245,7 @@ __wcschrnul (s, c)
# define STRLEN(S) __wcslen (S)
# define STRCAT(D, S) __wcscat (D, S)
# define MEMPCPY(D, S, N) __wmempcpy (D, S, N)
# define MEMCHR(S, C, N) wmemchr (S, C, N)
# define MEMCHR(S, C, N) __wmemchr (S, C, N)
# define STRCOLL(S1, S2) wcscoll (S1, S2)
# define WIDE_CHAR_VERSION 1
/* Change the name the header defines so it doesn't conflict with

View File

@ -19,7 +19,7 @@
#include <wchar.h>
wchar_t *
wmemchr (s, c, n)
__wmemchr (s, c, n)
const wchar_t *s;
wchar_t c;
size_t n;
@ -59,4 +59,6 @@ wmemchr (s, c, n)
return NULL;
}
libc_hidden_def (wmemchr)
libc_hidden_def (__wmemchr)
weak_alias (__wmemchr, wmemchr)
libc_hidden_weak (wmemchr)