Why warn about #include_next in system headers?
Neil Booth
neil@daikokuya.demon.co.uk
Tue Feb 6 00:23:00 GMT 2001
Alexandre Oliva wrote:-
> > Hmm, does -I/usr/include qualify for 2)?
>
> Yep. -isystem is the way to tell GCC to search a certain directory as
> a system header. -I is for non-system headers.
Thanks Alexandre - I was confused by CPP's output. Looking at the
source code in cppinit.c, maybe this has uncovered a bug.
If I execute, to test the effect of -I,
cpp -I/usr /tmp/test.c /dev/null -v
I get
#include "..." search starts here:
#include <...> search starts here:
/usr
/usr/local/include
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/2.97/include
/usr/local/i586-pc-linux-gnu/include
/usr/include
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).
This looks fishy to me, Zack. Is it right and I'm wrong in expecting
-I to put it under the "..." QUOTE path?
Neil.
More information about the Gcc-bugs
mailing list