This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] [BZ #18970]: Reference of pthread_setcancelstate in libc.a
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Thu, 17 Sep 2015 14:24:28 -0700
- Subject: Re: [PATCH] [BZ #18970]: Reference of pthread_setcancelstate in libc.a
- Authentication-results: sourceware.org; auth=none
- References: <20150917152135 dot GA25716 at intel dot com> <20150917195803 dot E05DF2C3B40 at topped-with-meat dot com>
On Thu, Sep 17, 2015 at 12:58 PM, Roland McGrath <roland@hack.frob.com> wrote:
> If this matters it should break some linknamespace test. If there is no
> reference from anything involved in the ISO C implementation, then there is
> no actual problem.
>
> For example, wordexp is a POSIX.1 function, so it referring directly to the
> public names of other POSIX.1 functions is not a problem.
>
> A change like this is not necessarily worthless even if it is not
> necessary. But you haven't said why you think the change is desireable.
> If it makes is easier to understand or maintain the code overall, then that
> could be sufficient reason. But you have to make some sort of positive
> case for a change.
Is this a valid test?
--
H.J.
diff --git a/stdlib/Makefile b/stdlib/Makefile
index 402466a..c99ad73 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -74,8 +74,8 @@ tests := tst-strtol tst-strtod testmb testrand testsort testdiv \
tst-makecontext3 bug-getcontext bug-fmtmsg1 \
tst-secure-getenv tst-strtod-overflow tst-strtod-round \
tst-tininess tst-strtod-underflow tst-tls-atexit \
- tst-setcontext3 tst-tls-atexit-nodelete
-tests-static := tst-secure-getenv
+ tst-setcontext3 tst-tls-atexit-nodelete tst-fmtmsg-static
+tests-static := tst-secure-getenv tst-fmtmsg-static
modules-names = tst-tls-atexit-lib
diff --git a/stdlib/tst-fmtmsg-static.c b/stdlib/tst-fmtmsg-static.c
new file mode 100644
index 0000000..60e6642
--- /dev/null
+++ b/stdlib/tst-fmtmsg-static.c
@@ -0,0 +1 @@
+#include "tst-fmtmsg.c"
diff --git a/stdlib/tst-fmtmsg.c b/stdlib/tst-fmtmsg.c
index b7948c5..de8d16a 100644
--- a/stdlib/tst-fmtmsg.c
+++ b/stdlib/tst-fmtmsg.c
@@ -81,5 +81,11 @@ do_test (void)
return result;
}
+int
+pthread_setcancelstate (int *p)
+{
+ return p[0];
+}
+
#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"