Skip to content

Commit ba5e39a

Browse files
committed
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)`.
1 parent 26a09a9 commit ba5e39a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/streams/openssl.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,8 @@ int git_openssl_stream_global_init(void)
252252
#if defined(GIT_THREADS)
253253
static void threadid_cb(CRYPTO_THREADID *threadid)
254254
{
255-
CRYPTO_THREADID_set_numeric(threadid, git_thread_currentid());
255+
GIT_UNUSED(threadid);
256+
CRYPTO_THREADID_set_numeric(threadid, git_thread_currentid());
256257
}
257258
#endif
258259

0 commit comments

Comments
 (0)