[Bug fortran/37821] [4.4 Regression] gfortran is ignoring #includes with the syntax <file.h>

burnus at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Tue Oct 14 12:32:00 GMT 2008



------- Comment #5 from burnus at gcc dot gnu dot org  2008-10-14 12:31 -------
(In reply to comment #3)
> #include "..." search starts here:
>  test_directory
>  /projects/tob/gcc-trunk/lib/gcc/x86_64-unknown-linux-gnu/4.4.0/finclude
>  .

That "." comes last is also wrong; it should come first for "...". However, CPP
automatically takes care.

Draft patch below; it works, except that I get the warning (-v -I tes):

ignoring duplicate directory "tes"  <<<<<<<<<<<<<<< Warning
#include "..." search starts here:
#include <...> search starts here:
 tes
 /projects/tob/gcc-trunk/lib/gcc/x86_64-unknown-linux-gnu/4.4.0/finclude
 /usr/local/include
 /projects/tob/gcc-trunk/include
 /projects/tob/gcc-trunk/lib/gcc/x86_64-unknown-linux-gnu/4.4.0/include
 /projects/tob/gcc-trunk/lib/gcc/x86_64-unknown-linux-gnu/4.4.0/include-fixed
 /usr/include
End of search list.

Index: cpp.c
===================================================================
--- cpp.c       (Revision 141104)
+++ cpp.c       (Arbeitskopie)
@@ -628,10 +628,9 @@ gfc_cpp_add_include_path (char *path, bo
 {
   /* CHAIN sets cpp_dir->sysp which differs from 0 if PATH is a system
      include path. Fortran does not define any system include paths.  */
-  int chain = 0;
   int cxx_aware = 0;

-  add_path (path, chain, cxx_aware, user_supplied);
+  add_path (path, BRACKET, cxx_aware, user_supplied);
 }

 void
Index: options.c
===================================================================
--- options.c   (Revision 141104)
+++ options.c   (Arbeitskopie)
@@ -266,8 +266,6 @@ gfc_post_options (const char **pfilename
       source_path[i] = 0;
       gfc_add_include_path (source_path, true);
     }
-  else
-    gfc_add_include_path (".", true);

   if (canon_source_file != gfc_source_file)
     gfc_free (CONST_CAST (char *, canon_source_file));


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37821



More information about the Gcc-bugs mailing list