]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR preprocessor/51303 (-Wmissing-include-dirs warnings reported as [enabled by...
authorManuel López-Ibáñez <manu@gcc.gnu.org>
Tue, 19 Aug 2014 22:52:02 +0000 (22:52 +0000)
committerManuel López-Ibáñez <manu@gcc.gnu.org>
Tue, 19 Aug 2014 22:52:02 +0000 (22:52 +0000)
gcc/ChangeLog:

2014-08-20  Manuel López-Ibáñez  <manu@gcc.gnu.org>

PR preprocessor/51303
* incpath.c (remove_duplicates): Use cpp_warning.

gcc/c-family/ChangeLog:

2014-08-20  Manuel López-Ibáñez  <manu@gcc.gnu.org>

PR preprocessor/51303
* c-common.c (struct reason_option_codes_t option_codes):
Add CPP_W_MISSING_INCLUDE_DIRS. Sort alphabetically.

gcc/testsuite/ChangeLog:

2014-08-20  Manuel López-Ibáñez  <manu@gcc.gnu.org>

PR preprocessor/51303
* gcc.dg/cpp/Wmissingdirs.c: Test for the warning option.

From-SVN: r214201

gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/incpath.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/cpp/Wmissingdirs.c

index 91c4a1fda9578096faf5b94cb397c7a2f8a45d7a..c1132d4628a1d5efa1bc70092a637e382c11b6f8 100644 (file)
@@ -1,3 +1,8 @@
+2014-08-20  Manuel López-Ibáñez  <manu@gcc.gnu.org>
+
+       PR preprocessor/51303
+       * incpath.c (remove_duplicates): Use cpp_warning.
+
 2014-08-20  Manuel López-Ibáñez  <manu@gcc.gnu.org>
 
        PR c/60975
index 34a91c8a74c0d0edc47f1274987467c9b4938b44..8119b06e650681e61e130321c84c5863d0850808 100644 (file)
@@ -1,3 +1,9 @@
+2014-08-20  Manuel López-Ibáñez  <manu@gcc.gnu.org>
+
+       PR preprocessor/51303
+       * c-common.c (struct reason_option_codes_t option_codes):
+       Add CPP_W_MISSING_INCLUDE_DIRS. Sort alphabetically.
+
 2014-08-20  Manuel López-Ibáñez  <manu@gcc.gnu.org>
 
        PR c/60975
index 901a5edd707939e80d60b51ac18d946372cb6c4e..c5eb2a773e619dd84ea572dcfbba701ce791fca1 100644 (file)
@@ -9680,23 +9680,24 @@ struct reason_option_codes_t
 };
 
 static const struct reason_option_codes_t option_codes[] = {
-  {CPP_W_DEPRECATED,                   OPT_Wdeprecated},
+  {CPP_W_BUILTIN_MACRO_REDEFINED,      OPT_Wbuiltin_macro_redefined},
   {CPP_W_COMMENTS,                     OPT_Wcomment},
-  {CPP_W_TRIGRAPHS,                    OPT_Wtrigraphs},
+  {CPP_W_CXX_OPERATOR_NAMES,           OPT_Wc___compat},
+  {CPP_W_DATE_TIME,                    OPT_Wdate_time},
+  {CPP_W_DEPRECATED,                   OPT_Wdeprecated},
+  {CPP_W_ENDIF_LABELS,                 OPT_Wendif_labels},
+  {CPP_W_INVALID_PCH,                  OPT_Winvalid_pch},
+  {CPP_W_LITERAL_SUFFIX,               OPT_Wliteral_suffix},
+  {CPP_W_LONG_LONG,                    OPT_Wlong_long},
+  {CPP_W_MISSING_INCLUDE_DIRS,          OPT_Wmissing_include_dirs},
   {CPP_W_MULTICHAR,                    OPT_Wmultichar},
+  {CPP_W_NORMALIZE,                    OPT_Wnormalized_},
   {CPP_W_TRADITIONAL,                  OPT_Wtraditional},
-  {CPP_W_LONG_LONG,                    OPT_Wlong_long},
-  {CPP_W_ENDIF_LABELS,                 OPT_Wendif_labels},
-  {CPP_W_VARIADIC_MACROS,              OPT_Wvariadic_macros},
-  {CPP_W_BUILTIN_MACRO_REDEFINED,      OPT_Wbuiltin_macro_redefined},
+  {CPP_W_TRIGRAPHS,                    OPT_Wtrigraphs},
   {CPP_W_UNDEF,                                OPT_Wundef},
   {CPP_W_UNUSED_MACROS,                        OPT_Wunused_macros},
-  {CPP_W_CXX_OPERATOR_NAMES,           OPT_Wc___compat},
-  {CPP_W_NORMALIZE,                    OPT_Wnormalized_},
-  {CPP_W_INVALID_PCH,                  OPT_Winvalid_pch},
+  {CPP_W_VARIADIC_MACROS,              OPT_Wvariadic_macros},
   {CPP_W_WARNING_DIRECTIVE,            OPT_Wcpp},
-  {CPP_W_LITERAL_SUFFIX,               OPT_Wliteral_suffix},
-  {CPP_W_DATE_TIME,                    OPT_Wdate_time},
   {CPP_W_NONE,                         0}
 };
 
index f495c0a7fc0c52e9f1aca9a04fd7c3f5dc643921..4ff00df479740f9f87b440fffc0503ae7498e775 100644 (file)
@@ -263,7 +263,8 @@ remove_duplicates (cpp_reader *pfile, struct cpp_dir *head,
              /* If -Wmissing-include-dirs is given, warn.  */
              cpp_options *opts = cpp_get_options (pfile);
              if (opts->warn_missing_include_dirs && cur->user_supplied_p)
-               cpp_errno (pfile, CPP_DL_WARNING, cur->name);
+               cpp_warning (pfile, CPP_W_MISSING_INCLUDE_DIRS, "%s: %s",
+                            cur->name, xstrerror (errno));
              reason = REASON_NOENT;
            }
        }
index 94f04227a9f94a645c8e294167fdf5230b1f0d5c..dc10ea9b2ff321b5e0f00066f5a253e269b92862 100644 (file)
@@ -1,3 +1,8 @@
+2014-08-20  Manuel López-Ibáñez  <manu@gcc.gnu.org>
+
+       PR preprocessor/51303
+       * gcc.dg/cpp/Wmissingdirs.c: Test for the warning option.
+
 2014-08-20  Manuel López-Ibáñez  <manu@gcc.gnu.org>
 
        PR c/60975
index 69b3aae3da603390ec85b2870513ff656d8a74fd..05154e25721b9098f951ec454523a6bf77bb5d8a 100644 (file)
@@ -4,4 +4,4 @@
 /* Test that -Wmissing-include-dirs issues a warning when a specified
    directory does not exist.  Source Ben Elliston, 2004-05-13.  */
 
-/* { dg-warning "No such file or directory" "-Wmissing-include-dirs" { target *-*-* } 0 } */
+/* { dg-warning "No such file or directory.*Wmissing-include-dirs" "-Wmissing-include-dirs" { target *-*-* } 0 } */