From: Bruno Haible Date: Tue, 16 Jun 2020 23:46:41 +0000 (+0200) Subject: thread: Avoid possible compiler warnings in uses of gl_thread_exit. X-Git-Tag: v1.0~3974 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=5233359455c1ae9818ba5b12baaba80f0bafaef6;p=gnulib.git thread: Avoid possible compiler warnings in uses of gl_thread_exit. * lib/glthread/thread.h (gl_thread_exit): Add a cast to void. --- 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