C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Revising #pragma once

From: Jeremy Rifkin <rifkin.jer_at_[hidden]>
Date: Tue, 27 Aug 2024 13:26:50 -0500
I’m not sure I’m following, sorry. Are you saying we can’t solve the
problem of implementation divergence because implementations diverge? Or
are you suggesting the chicken and egg problem that implementations must
agree on their own standard first? If so, what’s the point of the ISO
standard?

Filesystem id and paths are under-approximations tor the same header
contents. This proposal should make things more robust. The impact on
existing code is that previous #pragma once use where different files were
being included more than once will now exhibit single inclusion behavior.
Outside of niche cases where you are including a #pragma once header with
only macros, undefining everything, and then re-including another copy, I’m
not seeing any way current well-formed code could be impacted.

Jeremy

On Tue, Aug 27, 2024 at 12:51 Ville Voutilainen <ville.voutilainen_at_[hidden]>
wrote:

> On Tue, 27 Aug 2024 at 19:25, Jeremy Rifkin via Std-Proposals
> <std-proposals_at_[hidden]> wrote:
> >
> > Hi,
> > Thank you for your comments.
> >
> > > #pragma once is unimplementable.
> >
> > Every notable C/C++ compiler has implemented it.
>
> ..all differently, and some differently from what you propose. So, if
> your proposal is the solution to all woes,
> have you asked vendors that don't implement #pragma once like your
> proposal exactly right now to just implement it that way?
> That is, after all, what we need to standardize a One True #once, to
> have it implemented the same way everywhere, before we standardize
> it, not as a hypothetical wish that it will happen once we put a
> specification into a standard.
>

Received on 2024-08-27 18:27:04