[Bug 293859] C11's call_once requires nonstandard library -lstdthreads for linking
[email protected] Wed, 18 Mar 2026 23:55:23 +0000
| Newsgroups | gmane.os.freebsd.devel.standards |
|---|---|
| Message-ID | <[email protected]/bugzilla/> |
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293859 --- Comment #9 from Matthias Andree <[email protected]> --- I was thinking along the lines of https://learn.microsoft.com/en-us/cpp/preprocessor/comment-c-cpp?view=msvc-170's #pragma comment (which Boost would also use there), but I am also not aware of FreeBSD- or Linux- typical software supporting this. The Open Group Base Specifiations Issue 8 (2024) suggests that applications for POSIX systems should prefer the pthreads.h implementations over threads.h to avoid extra transition if they later wanted pthreads.h features missing from threads.h. These specs also document a "c17" utility that should make <threads.h> symbols available through -lpthread. Yes, that may pose interesting compatibility problems to FreeBSD because its thread history from way back when with -lthr and stuff. (OpenEXR does not request this utility nor C17 as standards version from the compiler, it'll make do with a C11-enabled compiler.) It would be nice if FreeBSD could, medium term, get closer to what other systems do to ease portability, but the cursory search in FreeBSD's Bugzilla only came up with 292622 as the other case. I presume C11 threads.h isn't in widespread use (yet). -- You are receiving this mail because: You are the assignee for the bug.