[Bug 293859] C11's call_once requires nonstandard library -lstdthreads for linking

[email protected] Mon, 16 Mar 2026 21:06:08 +0000
Newsgroups gmane.os.freebsd.devel.standards
Message-ID <[email protected]/bugzilla/>
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293859

Matthias Andree <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|C11/C++11's call_once       |C11's call_once requires
                   |requires nonstandard        |nonstandard library
                   |library -lstdthreads for    |-lstdthreads for linking
                   |linking                     |

--- Comment #4 from Matthias Andree <[email protected]> ---
Aha.  The plot thickens.  This seems to affect C11 only (which is what OpenEXR
3.4.7 really uses: it uses the underlying C11 function although it is a C++
program).

Summary revised accordingly ("C++" removed).


This links and runs properly on FreeBSD 15.0-RELEASE-p4 amd64:

// c++ try-callonce.cpp -Wall -Wextra -O2 -std=c++11 -pedantic-errors
#include <mutex>
#include <stdio.h>

void f(void) {
        puts("I am printing to create some observable effect.");
}

int main(void) {
        std::once_flag of;
        std::call_once(of, f);
        return 0;
}

-- 
You are receiving this mail because:
You are the assignee for the bug.