From 5233359455c1ae9818ba5b12baaba80f0bafaef6 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 17 Jun 2020 01:46:41 +0200 Subject: [PATCH] thread: Avoid possible compiler warnings in uses of gl_thread_exit. * lib/glthread/thread.h (gl_thread_exit): Add a cast to void. --- ChangeLog | 5 +++++ lib/glthread/thread.h | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ac5a761352..f31497e603 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2020-06-16 Bruno Haible + + thread: Avoid possible compiler warnings in uses of gl_thread_exit. + * lib/glthread/thread.h (gl_thread_exit): Add a cast to void. + 2020-06-16 Bruno Haible thread, thrd: Avoid a compiler warning. diff --git a/lib/glthread/thread.h b/lib/glthread/thread.h index 99a5074264..4077b45187 100644 --- a/lib/glthread/thread.h +++ b/lib/glthread/thread.h @@ -237,7 +237,7 @@ extern const gl_thread_t gl_null_thread; (pthread_in_use () ? (void *) pthread_self () : NULL) # endif # define gl_thread_exit(RETVAL) \ - (pthread_in_use () ? pthread_exit (RETVAL) : 0) + (void) (pthread_in_use () ? (pthread_exit (RETVAL), 0) : 0) # if HAVE_PTHREAD_ATFORK # define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) \ @@ -301,7 +301,7 @@ typedef int gl_thread_t; # define gl_thread_self() 0 # define gl_thread_self_pointer() \ ((void *) gl_thread_self ()) -# define gl_thread_exit(RETVAL) 0 +# define gl_thread_exit(RETVAL) (void)0 # define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) 0 #endif -- 2.39.5