]> Savannah Git Hosting - gnulib.git/commitdiff
thread: Avoid possible compiler warnings in uses of gl_thread_exit.
authorBruno Haible <bruno@clisp.org>
Tue, 16 Jun 2020 23:46:41 +0000 (01:46 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 16 Jun 2020 23:46:41 +0000 (01:46 +0200)
* lib/glthread/thread.h (gl_thread_exit): Add a cast to void.

ChangeLog
lib/glthread/thread.h

index ac5a761352f0eda40615f4c1522578e2e55baaec..f31497e6030bbd535ee5349c194e265df3278e95 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2020-06-16  Bruno Haible  <bruno@clisp.org>
+
+       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  <bruno@clisp.org>
 
        thread, thrd: Avoid a compiler warning.
index 99a50742648232e7c84cbf992568e69509d3d9f9..4077b45187c3ec8eb4bdc3777903c70772c50633 100644 (file)
@@ -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