[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] #include_next troubles
From: |
Edmund Grimley Evans |
Subject: |
Re: [Tinycc-devel] #include_next troubles |
Date: |
Wed, 21 Oct 2015 09:59:40 +0100 |
> From the clang code:
> ...
> // If this is a system #include, ignore the user #include locs.
> unsigned i = isAngled ? SystemDirIdx : 0;
> ...
> // If this is a #include_next request, start searching after the directory the
> // file was found in.
> if (FromDir)
> i = FromDir-&SearchDirs[0];
That's nice, readable code! But you also need to understand how GCC
handles duplicate directories in the search path. Some documentation
says this:
"Duplicate directories are removed from the quote and bracket search
chains before the two chains are merged to make the final search
chain. Thus, it is possible for a directory to occur twice in the
final search chain if it was specified in both the quote and bracket
chains."
It seems, from strace and ltrace, that GCC detects duplicates by
stat-ing the path and looking at st_dev and st_ino. If you do "ln -s
xx xx1" then GCC does not search in xx when you do "gcc -E -Ixx1
-Ixx".
Edmund
- Re: [Tinycc-devel] #include_next troubles, Sergey Korshunoff, 2015/10/17
- Re: [Tinycc-devel] #include_next troubles, Assaf Gordon, 2015/10/18
- Re: [Tinycc-devel] #include_next troubles, Sergey Korshunoff, 2015/10/19
- Re: [Tinycc-devel] #include_next troubles, Sergey Korshunoff, 2015/10/20
- Re: [Tinycc-devel] #include_next troubles, Sergey Korshunoff, 2015/10/20
- Re: [Tinycc-devel] #include_next troubles, grischka, 2015/10/20
- Re: [Tinycc-devel] #include_next troubles, Sergey Korshunoff, 2015/10/20
- Re: [Tinycc-devel] #include_next troubles, Edmund Grimley Evans, 2015/10/20
- Re: [Tinycc-devel] #include_next troubles, Sergey Korshunoff, 2015/10/20
- Re: [Tinycc-devel] #include_next troubles, grischka, 2015/10/20
- Re: [Tinycc-devel] #include_next troubles,
Edmund Grimley Evans <=
- Re: [Tinycc-devel] #include_next troubles, Sergey Korshunoff, 2015/10/21
- Re: [Tinycc-devel] #include_next troubles, Sergey Korshunoff, 2015/10/22