Index | Thread | Search

From:
Claudio Jeker <cjeker@diehard.n-r-g.com>
Subject:
libstdthreads fix type of mtx_t
To:
ports@openbsd.org
Date:
Mon, 17 Nov 2025 14:45:28 +0100

Download raw body.

Thread
This tripped over gcc15 in c23 mode. Our pthreads mutexes
(pthread_mutex_t) are typedef-ed to volatile struct pthread_mutex *
so this should do the same. 

-- 
:wq Claudio

Index: patches/patch-threads_h
===================================================================
RCS file: /cvs/ports/devel/libstdthreads/patches/patch-threads_h,v
diff -u -p -r1.1 patch-threads_h
--- patches/patch-threads_h	2 Sep 2024 16:39:12 -0000	1.1
+++ patches/patch-threads_h	30 Oct 2025 14:18:50 -0000
@@ -1,4 +1,5 @@
 __has_extension support added in gcc >= 14
+Fixup mtx_t definition to mirror pthread_mutex_t
 
 Index: threads.h
 --- threads.h.orig
@@ -14,3 +15,12 @@ Index: threads.h
  #if __has_extension(c_thread_safety_attributes)
  #define	__lock_annotate(x)	__attribute__((x))
  #else
+@@ -97,7 +101,7 @@
+  */
+ 
+ typedef struct pthread_cond	*cnd_t;
+-typedef struct pthread_mutex	*mtx_t;
++typedef volatile struct pthread_mutex	*mtx_t;
+ typedef struct pthread		*thrd_t;
+ typedef int			 tss_t;
+