This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: #include_next and absolute pathnames
- From: Neil Booth <neil at daikokuya dot co dot uk>
- To: Geoff Keating <geoffk at geoffk dot org>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 3 Mar 2003 21:42:01 +0000
- Subject: Re: #include_next and absolute pathnames
- References: <200303032051.h23KpTi02253@desire.geoffk.org>
Geoff Keating wrote:-
>
> Does anyone know (or care to propose) what #include_next should do
> in a file that's included with an absolute pathname?
>
> I'm thinking of
>
> #include "/usr/include/limits.h"
>
> or similar.
>
> I'm thinking "error message", but maybe we should preserve the current
> behaviour, which I think is that it behaves like #include.
I tend to like (surprise!) giving an error where nothing really sensible
can be done, but I expect that changing it now would break user-space
code that is including glibc headers via absolute paths with "".
I'm pretty certain such code exists; but I don't really care for it.
So I certainly won't object if we error-out.
I'd love to hear what your include improvements are. I had plans based
on caching lookups, indexed by basename. It gets tricky to sort out ""
vs. <> vs. the current directory, and file aliasing issues also crop
up a bit, but it would knock out a large number of open() and stat()
system calls. We currently do a lot, particularly if there are long
-I include chains and the relevant path is near the end (as it normally
is for standard headers).
Neil.