about summary refs log tree commit diff
path: root/sysdeps/pthread/tst-key2.c
diff options
context:
space:
mode:
authorMartin Sebor <msebor@redhat.com>2021-04-27 19:05:30 -0600
committerMartin Sebor <msebor@redhat.com>2021-04-27 19:07:49 -0600
commitb25b06749179d8d9a891381466e323a9dd2215f9 (patch)
treed97d85f31a972340e39525545b4670ca184aacca /sysdeps/pthread/tst-key2.c
parenta1561c3bbe8e72c6e44280d1eb5e529d2da4ecd0 (diff)
downloadglibc-b25b06749179d8d9a891381466e323a9dd2215f9.tar.gz
glibc-b25b06749179d8d9a891381466e323a9dd2215f9.tar.xz
glibc-b25b06749179d8d9a891381466e323a9dd2215f9.zip
Pass a valid pointer to pthread_setspecific to avoid GCC 11 warning.
Diffstat (limited to 'sysdeps/pthread/tst-key2.c')
-rw-r--r--sysdeps/pthread/tst-key2.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sysdeps/pthread/tst-key2.c b/sysdeps/pthread/tst-key2.c
index 6828873e41..28ba547073 100644
--- a/sysdeps/pthread/tst-key2.c
+++ b/sysdeps/pthread/tst-key2.c
@@ -56,7 +56,8 @@ tf (void *arg)
 {
   pthread_key_t *key = (pthread_key_t *) arg;
 
-  if (pthread_setspecific (*key, (void *) -1l) != 0)
+  /* Use an arbirary but valid pointer to avoid GCC warnings.  */
+  if (pthread_setspecific (*key, arg) != 0)
     {
       write_message ("setspecific failed\n");
       _exit (1);