[patch,fortran] Fix INCLUDE with full path (PR30276)

Tobias Burnus burnus@net-b.de
Tue Jan 2 15:35:00 GMT 2007


:ADDPATCH fortran:

Hi all,

first, I'd like to wish a belate happy new year.

Secondly, gfortran currently fails to INCLUDE files specified by the
full path, e.g.

   include '/home/allan/slot2usl/physcons.inc'

The logic in gcc/fortran/scanner.c's open_included_file is:

  for include_path in include_paths
     try-to-open( include_path + filename )


The fix is simple: Try first to open the file without prefixing an
include path.

The following patch was tested on x86_64-unknown-linux-gnu; I also did
bootstrap and regression test it; furthermore, the patch was
pre-approved by Steven Bosscher (see PR30276). I don't see how one could
create a regression test for this ;-)

Ok for the trunk and after a week for 4.2?

Tobias


2007-01-02  Tobias Burnus  <burnus@net-b.de>

    PR fortran/30276
    * scanner.c (open_included_file): Support full-path filenames.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: include.diff
Type: text/x-patch
Size: 706 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070102/709350e1/attachment.bin>


More information about the Gcc-patches mailing list