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>>

_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to