C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Revising #pragma once

From: Gašper Ažman <gasper.azman_at_[hidden]>
Date: Tue, 27 Aug 2024 17:10:30 +0100
Bringing in 3p software becomes exponentially harder if it's using #pragma
once. In some cases, because I can't legally change the source code, I have
to somehow create forwarding headers which wrap the 3p headers with include
guards.

Still better than conda though :)

On Tue, Aug 27, 2024 at 5:07 PM Jens Maurer via Std-Proposals <
std-proposals_at_[hidden]> wrote:

>
>
> On 27/08/2024 17.53, Sebastian Wittmeier via Std-Proposals wrote:
> > Hi Gašper,
> >
> >> #pragma once is unimplementable.
> >
> > That may be the case, nevertheless "all" compilers offer it.
> >
> > Why not make the notion, whether a file is the same
> implementation-defined.
> >
> >
> >
> > Everybody deeply involved in large build systems and farms and the ones
> doing the company C++ Coding Guidelines knows about the pitfalls with hard
> links and can judge, whether it should be allowed;
> >
> > everybody else would perhaps use #pragma once even now without
> standardization.
> >
> >
> > What risks would you see due to standardization for which user group?
>
> We seem to agree that "#pragma once" is not the way to go for large
> projects. Why should we give the impression we support and/or recommend
> using "#pragma once" when that's actually bad advice when a user moves
> from "toy project" to "large project", e.g. by being hired by Gasper?
>
> Jens
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>

Received on 2024-08-27 16:10:47