On Fri, Jan 09, 2026 at 08:57:25PM +0100, Thomas König wrote: > As analyzed by Steve, on freebsd __gthread_t is a pointer type. > I thought it the cleanest solution to remove the #ifdef in gfc_unit, > make the "self" member a intptr_t and cast the return value of > __gthread_t to that type. > > Sorry for breaking bootstrap... the ubiquity of Linux is really > striking here. There are a couple of > > Regression-tested on Linux. FreeBSD should also work, but I'd > like confirmation, if possible. Steve, could you be so kind? > > OK for trunk? >
Fixes bootstrap and regression tests cleanly. Ok to commit. Nothing to be sorry about! Things can break at the top-of-tree. Plus, I learned something, from the linux pthread_self() man page: POSIX.1 allows an implementation wide freedom in choosing the type used to represent a thread ID; for example, representation using either an arithmetic type or a structure is permitted. Therefore, variables of type pthread_t can't portably be compared using the C equality operator (==); use pthread_equal(3) instead. Thread identifiers should be considered opaque: any attempt to use a thread ID other than in pthreads calls is nonportable and can lead to unspecified results. -- Steve
