This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: #include_next and absolute pathnames


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]