This is the mail archive of the gcc-bugs@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]

[Fwd: Re: cpp behavior problem]



--- Begin Message ---
Correct.  However, if a file included with <> includes a file with "" it
is found even if it is in a directory specified by -I as long as that
directory is the same one the file with <> was found or further down the
include path search.  Does this make sense?  This could be by design.

Using the -I- option, you can add to the system directory search list
(#include <>).  This allows directories to be searched in the same
manner as with the "" method.  However, if you have -I. -I- -I. then the
current directory isn't searched for the <> cases.  This could very well
be considered a bug according to the cpp man page description.

It is somewhat of a complicated mechanism without any real explanatory
documentation.

Sean

On Thu, 2002-10-24 at 22:51, Neil Booth wrote:
> Sean McNeil wrote:-
> 
> > Hi folks,
> > 
> > I'm having trouble with the cpp.  Basically, it appears to be
> > inconsistent in how it picks up included files.
> > 
> > If a routine includes a file with <>, then it will pick up my file from
> > the directory in a -I command argument.  This file includes another file
> > with "".  That file will only be picked up within the current include
> > path or farther down.  This is not really documented anywhere.  The docs
> > say any include using <> can be controlled with the -I- option.  I don't
> > use this option, though.  I've got additional problems when I do (-I.
> > ..... -I- -I. .... won't allow for the current directory searched when
> > <> is used).
> 
> <> is supposed to be for system headers.  System headers can only
> include other system headers, and so should be using <> too.
> However, I don't see anything in the code that should be enforcing this.
> 
> Further, <> never searches the current directory.  "." is the compiler's
> directory, not the current file's directory.
> 
> Neil.

--- End Message ---

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