tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Relative paths of include files are not normalised, w


From: Herman ten Brugge
Subject: Re: [Tinycc-devel] Relative paths of include files are not normalised, which can break #pragma once
Date: Sun, 25 Jun 2023 20:30:28 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0

On 6/24/23 08:05, Jonathan Newman wrote:
Hi,
While working on a project with a messy structure and a reliance on #pragma once, I ran into this issue.

Essentially, TCC considers the following to be different files for the purposes of respecting #pragma once:

#include "test.h"
#include "./test.h"
#include "foo/../test.h"

// In subdir/test2.h:
#include "../test.h"

The result is that test.h is included repeatedly despite using #pragma once.

Of course, that feature is non-standard and well-known to be potentially troublesome. But it's used widely enough that I think this is worth fixing.

I've attached a test case. There's an interesting difference in behaviour between Windows and Linux when a non-existent path is involved, but the overall issue applies regardless of platform.

I just pushed a patch to fix this.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]