From b44135942e122f6a9d3fc5d8df6ca9d7a6b72bef Mon Sep 17 00:00:00 2001 From: =?utf8?q?Manuel=20L=C3=B3pez-Ib=C3=A1=C3=B1ez?= Date: Tue, 19 Aug 2014 22:52:02 +0000 Subject: [PATCH] re PR preprocessor/51303 (-Wmissing-include-dirs warnings reported as [enabled by default]) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit gcc/ChangeLog: 2014-08-20 Manuel López-Ibáñez PR preprocessor/51303 * incpath.c (remove_duplicates): Use cpp_warning. gcc/c-family/ChangeLog: 2014-08-20 Manuel López-Ibáñez 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 PR preprocessor/51303 * gcc.dg/cpp/Wmissingdirs.c: Test for the warning option. From-SVN: r214201 --- gcc/ChangeLog | 5 +++++ gcc/c-family/ChangeLog | 6 ++++++ gcc/c-family/c-common.c | 23 ++++++++++++----------- gcc/incpath.c | 3 ++- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/cpp/Wmissingdirs.c | 2 +- 6 files changed, 31 insertions(+), 13 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 91c4a1fda957..c1132d4628a1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2014-08-20 Manuel López-Ibáñez + + PR preprocessor/51303 + * incpath.c (remove_duplicates): Use cpp_warning. + 2014-08-20 Manuel López-Ibáñez PR c/60975 diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 34a91c8a74c0..8119b06e6506 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,9 @@ +2014-08-20 Manuel López-Ibáñez + + 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 PR c/60975 diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 901a5edd7079..c5eb2a773e61 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -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} }; diff --git a/gcc/incpath.c b/gcc/incpath.c index f495c0a7fc0c..4ff00df47974 100644 --- a/gcc/incpath.c +++ b/gcc/incpath.c @@ -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; } } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 94f04227a9f9..dc10ea9b2ff3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-08-20 Manuel López-Ibáñez + + PR preprocessor/51303 + * gcc.dg/cpp/Wmissingdirs.c: Test for the warning option. + 2014-08-20 Manuel López-Ibáñez PR c/60975 diff --git a/gcc/testsuite/gcc.dg/cpp/Wmissingdirs.c b/gcc/testsuite/gcc.dg/cpp/Wmissingdirs.c index 69b3aae3da60..05154e25721b 100644 --- a/gcc/testsuite/gcc.dg/cpp/Wmissingdirs.c +++ b/gcc/testsuite/gcc.dg/cpp/Wmissingdirs.c @@ -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 } */ -- 2.47.3