C++ Logo


Advanced search

Re: [wg14/wg21 liaison] #once proposal

From: Steve Downey <sdowney_at_[hidden]>
Date: Thu, 3 Feb 2022 16:58:27 -0500
On Thu, Feb 3, 2022, 15:08 Christof Meerwald via Liaison <
liaison_at_[hidden]> wrote:

> On Thu, Feb 03, 2022 at 08:50:30PM +0100, Miguel Ojeda via Liaison wrote:
> > On Thu, Feb 3, 2022 at 8:29 PM Steve Downey via Liaison
> > <liaison_at_[hidden]> wrote:
> > > Is there any chance that this gets adopted? Because at scale it
> doesn't work, and causes both structural and transient problems, and it
> will be even harder to get people not to use it if it's in the standard.
> >
> > Of course there is a chance -- as with any other proposal. The
> > no-identifier form does have pitfalls depending on how a compiler
> > defines it, but it is widely used everywhere. The paper is
> > standardizing existing practice (and, by doing that, asking compilers
> > to document it).
> Existing practice is to use "#pragma once" which already has
> implementation defined behavior - the paper proposes to change
> "#pragma once" to "#once" with implementation defined behavior.
> Doesn't really look like much of an improvement to me.
> Christof

"defined" seems to be overstating things a bit, too. They mostly don't
really define what they do, they just say they attempt to not open the same
file twice.

And then when we report bugs to vendors, they basically say "yes, it's
broken, we'll add it to the list of ways it doesn't work."

Received on 2022-02-03 21:58:41