streams: openssl: fix bogus warning on unused parameter Our provided callback function `threadid_cb(CRYPTO_THREADID *threadid)` sets up a unique thread ID by asking pthread for the current thread ID. Since openssl version 1.1, `CRYPTO_THREADID_set_numeric` is simply a no-op macro, leaving the `threadid` argument unused after the preprocessor has processed the macro. GCC does not account for that situation and will thus complain about `threadid` being unused. Silence this warning by using `GIT_UNUSED(threadid)`.
diff --git a/src/streams/openssl.c b/src/streams/openssl.c
index d1bcbf2..8cce844 100644
--- a/src/streams/openssl.c
+++ b/src/streams/openssl.c
@@ -252,7 +252,8 @@ int git_openssl_stream_global_init(void)
#if defined(GIT_THREADS)
static void threadid_cb(CRYPTO_THREADID *threadid)
{
- CRYPTO_THREADID_set_numeric(threadid, git_thread_currentid());
+ GIT_UNUSED(threadid);
+ CRYPTO_THREADID_set_numeric(threadid, git_thread_currentid());
}
#endif