Skip to content

Commit 186768a

Browse files
committed
use valid address in pthread_setspecific to silence warnings
1 parent 2ae7b98 commit 186768a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

thread_setup_unix.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ static pthread_mutex_t *mutex_buf = NULL;
99

1010
static pthread_key_t destructor_key;
1111

12+
static char dummy;
13+
1214
/* Used by unit tests. */
1315
volatile unsigned int go_openssl_threads_cleaned_up = 0;
1416

@@ -29,7 +31,7 @@ static void thread_id(GO_CRYPTO_THREADID_PTR tid)
2931
// least once on any thread with associated error state. The thread-local
3032
// variable needs to be set to a non-NULL value so that the destructor will
3133
// be called when the thread exits. The actual value does not matter.
32-
(void) pthread_setspecific(destructor_key, (void*)1);
34+
(void) pthread_setspecific(destructor_key, &dummy);
3335
}
3436

3537
static void cleanup_thread_state(void *ignored)

0 commit comments

Comments
 (0)