This is the mail archive of the
mailing list for the GCC project.
Re: [Fortran, Patch] Fix CPP <include_path> (PR 37821)
- From: Tobias Burnus <burnus at net-b dot de>
- To: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Tue, 21 Oct 2008 18:28:15 +0200
- Subject: Re: [Fortran, Patch] Fix CPP <include_path> (PR 37821)
- References: <20081016185253.GA12858@net-b.de>
first I would like to know how gfortran should handle the following:
$ gfortran dir1/source_file1 dir2/source_file2
In "gcc" an
succeeds for source_file1 but fails for source_file2.
In "gfortran" a
will work for both source_file1 as for source_file2
The question is what should happen for
in gfortran? The same as for C's #include "..." or the same as for
That determines whether one should use
+ if (quote)
+ add_path (path, BRACKET, cxx_aware, user_supplied);
+ add_path (path, quote ? QUOTE : BRACKET, cxx_aware, user_supplied);
In any case I would be delighted if someone could give some feedback.
Except for this point, the patch can also be reviewed...
Tobias Burnus wrote:
> Hi all,
> attached a revised patch as the previous patch broke "include"
> ("#include" worked) for ".".
> The new patch features:
> * #include "..." and include '...' test cases
> * directories where the source files resist come first
> in the include list (both #include "..." and include)
> * "." is not added for #include "..." as licpp does so
> * the location of the sourcefile is not added for
> #include <...> but -I dir is also used for <...>
> (This was the problem reported in the PR.)
> * With explicit -cpp the -I dir are only passed once
> to f951 (still twice for the implict (.F etc.) cpp
> Bootstrapped and regtested on x86-64-linux
> I also did several manual tests (for -cpp the "-v" option
> shows the search paths). [I would not mind if someone could
> also playround with include (w/ and w/o -cpp) and with
> #include "..." and #include <...>. I think everything should
> work, but I'm not positive.]
> OK for the trunk?
> PS: I have just started wondering whether libcpp automatically
> adds "subdir" to the search path for "gfortran subdir/file.F".
> I'm not sure whether I tested this; I think with this
> patch the path is added, which might not be needed but it
> does not harm (= does what is should and shows no warning
> with -v [this is also tested for by the new test case]).