[Fortran, Patch] Fix CPP <include_path> (PR 37821)

Tobias Burnus burnus@net-b.de
Thu Oct 16 18:53:00 GMT 2008


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
  automatically
* 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
  calling).

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?

Tobias

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]).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cpp.diff
Type: text/x-patch
Size: 8377 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20081016/ffa4be66/attachment.bin>


More information about the Fortran mailing list