C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Revising #pragma once

From: Jeremy Rifkin <rifkin.jer_at_[hidden]>
Date: Sun, 1 Sep 2024 11:17:05 -0500
> IMNSHO, if implementations have such different conclusions that do affect code generation and even syntactical results, the feature is not properly standardised.

I agree. Much of the point of standardizing would be providing
guarantees about what "same file" means.

For wording, one option is to borrow some wording from
std::filesystem::equivalent. Something along the lines of "#pragma
once shall prevent subsequent replacement by an #include directive of
any file residing on the same device at the same location." Care will
have to be taken to accommodate any #includes that do not resolve to a
file on a filesystem.

Jeremy

On Sun, Sep 1, 2024 at 10:50 AM Thiago Macieira via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> On Sunday 1 September 2024 08:42:30 GMT-7 Tiago Freire wrote:
> > > The standardisation would need to describe the actual system calls needed
> > > to achieve identification.
> > Would it?
> > Maybe the problem is to try to define it in these terms.
> > The way I see it, you don't have to.
> > Even though same path= same file seems to be bare minimum, do we need to
> > specify that we are reading a file from a filesystem? Do we want to even
> > put on such constraints? Just say generic "same thing" and call it a day.
> > Honestly, what else do you need to say?
>
> As Tom's report showed, different implementations will come to different
> conclusions of what "same file" is and thus will compile differently. IMNSHO, if
> implementations have such different conclusions that do affect code generation
> and even syntactical results, the feature is not properly standardised.
>
> --
> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
> Principal Engineer - Intel DCAI Platform & System Engineering
>
>
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

Received on 2024-09-01 16:17:18