[Bug fortran/55534] -Wno-missing-include-dirs does not work with gfortran

burnus at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Dec 5 09:29:00 GMT 2012


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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org,
                   |                            |tkoenig at gcc dot gnu.org

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-12-05 09:29:08 UTC ---
(See PR 54033 for the patch which originally added this feature.)

Untested patch.

--- a/gcc/fortran/cpp.c
+++ b/gcc/fortran/cpp.c
@@ -471,2 +471,3 @@ gfc_cpp_post_options (void)
   cpp_option->preprocessed = gfc_option.flag_preprocessed;
+  cpp_option->warn_missing_include_dirs =
gfc_option.warn_missing_include_dirs;

diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index bf767b2..6f3515f 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -2236,2 +2236,3 @@ typedef struct
   int warn_target_lifetime;
+  int warn_missing_include_dirs;
   int max_errors;
diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c
index e05b935..489d1ff 100644
--- a/gcc/fortran/options.c
+++ b/gcc/fortran/options.c
@@ -117,2 +117,3 @@ gfc_init_options (unsigned int decoded_options_count,
   gfc_option.warn_target_lifetime = 0;
+  gfc_option.warn_missing_include_dirs = 0;
   gfc_option.max_errors = 25;
@@ -478,2 +485,3 @@ set_Wall (int setting)
   gfc_option.warn_target_lifetime = setting;
+  gfc_option.warn_missing_include_dirs = setting;

@@ -686,2 +694,6 @@ gfc_handle_option (size_t scode, const char *arg, int
value,

+    case OPT_Wmissing_include_dirs:
+      gfc_option.warn_missing_include_dirs = value;
+      break;
+
     case OPT_Wrealloc_lhs:
diff --git a/gcc/fortran/scanner.c b/gcc/fortran/scanner.c
index 765c0f9..2bdd87f 100644
--- a/gcc/fortran/scanner.c
+++ b/gcc/fortran/scanner.c
@@ -327,4 +327,3 @@ add_path_to_list (gfc_directorylist **list, const char
*path,
        {
-         /* FIXME:  Also support -Wmissing-include-dirs.  */
-         if (warn)
+         if (warn && gfc_option.warn_missing_include_dirs)
            gfc_warning_now ("Nonexistent include directory \"%s\"", path);



More information about the Gcc-bugs mailing list