tinycc-devel
[Top][All Lists]
Advanced

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

[Tinycc-devel] Relative paths of include files are not normalised, which


From: Jonathan Newman
Subject: [Tinycc-devel] Relative paths of include files are not normalised, which can break #pragma once
Date: Sat, 24 Jun 2023 07:05:43 +0100

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.

Attachment: tcc_include_path_issue_testcase.zip
Description: Zip compressed data


reply via email to

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