diff options
Diffstat (limited to 'gcc/fortran/cpp.c')
-rw-r--r-- | gcc/fortran/cpp.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/gcc/fortran/cpp.c b/gcc/fortran/cpp.c index ec8bb59..6ff464a 100644 --- a/gcc/fortran/cpp.c +++ b/gcc/fortran/cpp.c @@ -137,9 +137,9 @@ static void cb_include (cpp_reader *, source_location, const unsigned char *, static void cb_ident (cpp_reader *, source_location, const cpp_string *); static void cb_used_define (cpp_reader *, source_location, cpp_hashnode *); static void cb_used_undef (cpp_reader *, source_location, cpp_hashnode *); -static bool cb_cpp_error (cpp_reader *, int, location_t, unsigned int, +static bool cb_cpp_error (cpp_reader *, int, int, location_t, unsigned int, const char *, va_list *) - ATTRIBUTE_GCC_DIAG(5,0); + ATTRIBUTE_GCC_DIAG(6,0); void pp_dir_change (cpp_reader *, const char *); static int dump_macro (cpp_reader *, cpp_hashnode *, void *); @@ -962,13 +962,14 @@ cb_used_define (cpp_reader *pfile, source_location line ATTRIBUTE_UNUSED, } /* Callback from cpp_error for PFILE to print diagnostics from the - preprocessor. The diagnostic is of type LEVEL, at location + preprocessor. The diagnostic is of type LEVEL, with REASON set + to the reason code if LEVEL is represents a warning, at location LOCATION, with column number possibly overridden by COLUMN_OVERRIDE if not zero; MSG is the translated message and AP the arguments. Returns true if a diagnostic was emitted, false otherwise. */ static bool -cb_cpp_error (cpp_reader *pfile ATTRIBUTE_UNUSED, int level, +cb_cpp_error (cpp_reader *pfile ATTRIBUTE_UNUSED, int level, int reason, location_t location, unsigned int column_override, const char *msg, va_list *ap) { @@ -1007,6 +1008,8 @@ cb_cpp_error (cpp_reader *pfile ATTRIBUTE_UNUSED, int level, location, dlevel); if (column_override) diagnostic_override_column (&diagnostic, column_override); + if (reason == CPP_W_WARNING_DIRECTIVE) + diagnostic_override_option_index (&diagnostic, OPT_Wcpp); ret = report_diagnostic (&diagnostic); if (level == CPP_DL_WARNING_SYSHDR) warn_system_headers = save_warn_system_headers; @@ -1090,5 +1093,3 @@ dump_queued_macros (cpp_reader *pfile ATTRIBUTE_UNUSED) } cpp_undefine_queue = NULL; } - - |