2026-04-25 Paul Eggert <eggert@cs.ucla.edu>
+ thread: better nonreturn fix for gl_thread_create
+ * lib/glthread/thread.c (gl_thread_create):
+ Define as a function only if multithreading.
+ This is cleaner than my previous patch today that sometimes made
+ it _Noreturn, as the function’s definition and declaration now always
+ agree on noreturnedness, and it pushes the noreturnedness issue up
+ to the caller. Also, it suppresses GCC’s “warning: function
+ declared 'noreturn' has a 'return' statement”.
+
thread: pacify gcc -Wunused-value
* lib/glthread/thread.h (glthread_atfork, glthread_sigmask)
(glthread_create, glthread_join): Evaluate arguments even when
/* ========================================================================= */
-#if !(USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS \
- || USE_WINDOWS_THREADS)
-_Noreturn
-#endif
+#if (USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS \
+ || USE_WINDOWS_THREADS)
gl_thread_t
gl_thread_create (void *(*func) (void *arg), void *arg)
{
abort ();
return thread;
}
+#endif