This is the mail archive of the
mailing list for the GCC project.
Option -I- and standard headers
- To: gcc at gcc dot gnu dot org
- Subject: Option -I- and standard headers
- From: Brad King <brad dot king at kitware dot com>
- Date: Thu, 25 Oct 2001 11:28:08 -0400 (EDT)
I just created a file with only one line:
---- t.cxx ----
----- end -----
I then ran GCC 3.0 on it with the "-I-" option like this:
gcc -I- -c t.cxx
The result was a preprocessor error with a library header that could not
be found. After a series of includes, the file
has the line
This includes a file in the same directory, but depends on the fact that
the preprocessor searches a file's own directory for include files
first. The -I- option breaks this, so it cannot be used unless
is added explicitly. I don't think this is the desired behavior because
the user should not have to dig into GCC's internal include paths just to
use the -I- option for his/her own project, especially because the
internal paths have platform-dependent names.
A simple fix is to change the line mentioned above to
because $PREFIX/include/g++-v3/$PLATFORM is already a standard include
search path entry. Then, even when -I- is specified, the headers can
still be found.
I assume the other gthr-* include lines in gthr.h would also need the same
change. There may also be other headers in the 3.0 standard library with
the same problem, but they don't show up from just including iostream.
Am I missing something, or is this a bug in the headers?