diff options
author | Martin Sebor <msebor@redhat.com> | 2021-04-27 19:05:30 -0600 |
---|---|---|
committer | Martin Sebor <msebor@redhat.com> | 2021-04-27 19:07:49 -0600 |
commit | b25b06749179d8d9a891381466e323a9dd2215f9 (patch) | |
tree | d97d85f31a972340e39525545b4670ca184aacca /sysdeps/pthread/tst-tsd6.c | |
parent | a1561c3bbe8e72c6e44280d1eb5e529d2da4ecd0 (diff) | |
download | glibc-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-tsd6.c')
-rw-r--r-- | sysdeps/pthread/tst-tsd6.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sysdeps/pthread/tst-tsd6.c b/sysdeps/pthread/tst-tsd6.c index debb1dd367..5f2aa42e98 100644 --- a/sysdeps/pthread/tst-tsd6.c +++ b/sysdeps/pthread/tst-tsd6.c @@ -17,7 +17,8 @@ tf (void *arg) for (int i = 0; i < NKEYS; ++i) { void *p = pthread_getspecific (keys[i]); - pthread_setspecific (keys[i], (void *) 7); + /* Use an arbitrary but valid pointer as the value. */ + pthread_setspecific (keys[i], (void *) keys); if (p != NULL) res = p; } |