C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Revising #pragma once

From: Tiago Freire <tmiguelf_at_[hidden]>
Date: Mon, 2 Sep 2024 12:11:35 +0000
> The (main) problem has never been two distinct files having the same path. The problem is one and the same file having different paths (and inodes, etc.).
It fails to be recognized as the Same File in multiple places, attempts to redefine non-inline entities, and builds break.

Great, don't do that then!



-----Original Message-----
From: Ville Voutilainen <ville.voutilainen_at_[hidden]>
Sent: Monday, September 2, 2024 2:10 PM
To: Tiago Freire <tmiguelf_at_hotmail.com>
Cc: Jonathan Wakely <cxx_at_kayari.org>; std-proposals_at_lists.isocpp.org; Tom Honermann <tom_at_honermann.net>
Subject: Re: [std-proposals] Revising #pragma once

On Mon, 2 Sept 2024 at 15:02, Tiago Freire <tmiguelf_at_hotmail.com> wrote:
>
> > The reason #include "works" even if inode numbers are reused or
> > paths are not unique is not because including them by pathname makes
> > it work. It's because the headers files have include guards in them,
>
>
>
> Wrong! Unless you are modifying files as you compile. It has never happened that 2 distinct files occupy the same filepath and the compiler had to make a decision between one of them. (except maybe on a MAC, think smort… screw that platform).

The (main) problem has never been two distinct files having the same path. The problem is one and the same file having different paths (and inodes, etc.).
It fails to be recognized as the Same File in multiple places, attempts to redefine non-inline entities, and builds break.

Received on 2024-09-02 12:11:38