This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Why warn about #include_next in system headers?
On Tue, Feb 06, 2001 at 06:54:07PM +0000, Neil Booth wrote:
> Zack Weinberg wrote:-
>
> > > This is what was confusing me. The /usr appears after the <...> in
> > > the list - I expected it to be under the "...". Looking at cppinit.c,
> > > I notice that *nowhere* calls append_include_chain with "QUOTE" as the
> > > include chain to put the path on (i.e. we could eliminate the QUOTE
> > > enumeration constant).
> >
> > You've forgotten -I-.
>
> Ah yes. Damn this search path stuff is confusing.
>
> We can still get rid of QUOTE if we want. I believe Glibc uses -I-;
> I've certainly seen it used somewhere.
Post 3.0 I'd like to look at moving all of the search path generation
logic into the driver, sort of the way we did with CPP_PREDEFINES long
ago.
cpplib would be cut down to three include-path switches:
-I same as now (incl. -I-)
-isystem same as now
-inotc++aware -isystem + headers are not C++ aware;
currently impossible to get this effect
on the command line (only for !defined
NO_IMPLICIT_EXTERN_C)
and the driver would be responsible for translating all the other
-iblah options. Also, there would be no hardwired default include
path in cpplib; the driver would be responsible for specifying it with
-isystem and -inotc++aware options (and for filtering out the
C++-only directories).
cppdefault.c goes away, huge chunks of cppinit.c likewise, we don't
have to link prefix.c into cpplib anymore, and tradcpp magically gets
support for all the -iblah switches (currently we punt most of them).
The price is more code in the driver, but I think that's where icky
command-line manipulation belongs.
Possibly this can be done in conjunction with Neil's proposed driver
rewrite.
zw