C++ Logo

std-proposals

Advanced search

Re: [std-proposals] int Func(void) noreentry(-1)

From: Thiago Macieira <thiago_at_[hidden]>
Date: Sun, 12 Feb 2023 18:28:48 -0800
On Sunday, 12 February 2023 17:14:00 PST Jason McKesson via Std-Proposals
wrote:
> It's not like there's an attribute that can turn it
> off or something.

There's a compiler flag (-fno-threadsafe-statics). I don't think it exists as a
variable attribute, though.

We tried to use it for a time back in the mid-Qt 4.x days, when the feature
was new and couldn't be counted on, to save a bit of memory space (the guard
variables) and codegen. It turns out that since this option was never tested,
GCC generated very broken code.

That means this is a feature of C++ that you pay for, whether you need it or
not.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel DCAI Cloud Engineering

Received on 2023-02-13 02:28:49