From b25b06749179d8d9a891381466e323a9dd2215f9 Mon Sep 17 00:00:00 2001 From: Martin Sebor Date: Tue, 27 Apr 2021 19:05:30 -0600 Subject: Pass a valid pointer to pthread_setspecific to avoid GCC 11 warning. --- sysdeps/pthread/tst-key2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sysdeps/pthread/tst-key2.c') 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); -- cgit 1.4.1