about summary refs log tree commit diff
path: root/nptl/tst-tsd4.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 /nptl/tst-tsd4.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 'nptl/tst-tsd4.c')
-rw-r--r--nptl/tst-tsd4.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/nptl/tst-tsd4.c b/nptl/tst-tsd4.c
index cc1ada4d4d..d72219466f 100644
--- a/nptl/tst-tsd4.c
+++ b/nptl/tst-tsd4.c
@@ -34,7 +34,8 @@ destr (void *arg)
 {
   ++rounds;
 
-  if (pthread_setspecific (key, (void *) 1l) != 0)
+  /* Use an arbirary but valid pointer to avoid GCC warnings.  */
+  if (pthread_setspecific (key, (void *) &rounds) != 0)
     {
       puts ("destr: setspecific failed");
       exit (1);
@@ -45,7 +46,8 @@ destr (void *arg)
 static void *
 tf (void *arg)
 {
-  if (pthread_setspecific (key, (void *) 1l) != 0)
+  /* Use an arbirary but valid pointer to avoid GCC warnings.  */
+  if (pthread_setspecific (key, (void *) &rounds) != 0)
     {
       puts ("tf: setspecific failed");
       exit (1);