aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/parse.c
diff options
context:
space:
mode:
authorManuel López-Ibáñez <manu@gcc.gnu.org>2014-12-11 15:13:33 +0000
committerManuel López-Ibáñez <manu@gcc.gnu.org>2014-12-11 15:13:33 +0000
commitc4100eaea3acd1a0d88050ad721f36470a0a6e5d (patch)
tree6688e37de9262fa9b6efc826ef89c8b02ae776ba /gcc/fortran/parse.c
parent217d0904fab9c653eeefe27d94cb73f5516c4d83 (diff)
downloadgcc-c4100eaea3acd1a0d88050ad721f36470a0a6e5d.zip
gcc-c4100eaea3acd1a0d88050ad721f36470a0a6e5d.tar.gz
gcc-c4100eaea3acd1a0d88050ad721f36470a0a6e5d.tar.bz2
re PR fortran/44054 (Handle -Werror, -Werror=, -fdiagnostics-show-option, !GCC$ diagnostic (pragmas) and color)
gcc/ChangeLog: 2014-12-11 Manuel López-Ibáñez <manu@gcc.gnu.org> PR fortran/44054 * diagnostic.c (diagnostic_action_after_output): Make it extern. Take diagnostic_t argument instead of diagnostic_info. Count also DK_WERROR towards max_errors. (diagnostic_report_diagnostic): Update call according to the above. (error_recursion): Likewise. * diagnostic.h (diagnostic_action_after_output): Declare. * pretty-print.c (pp_formatted_text_data): Delete. (pp_append_r): Call output_buffer_append_r. (pp_formatted_text): Call output_buffer_formatted_text. (pp_last_position_in_text): Call output_buffer_last_position_in_text. * pretty-print.h (output_buffer_formatted_text): New. (output_buffer_append_r): New. (output_buffer_last_position_in_text): New. gcc/fortran/ChangeLog: 2014-12-11 Manuel López-Ibáñez <manu@gcc.gnu.org> PR fortran/44054 * error.c (pp_error_buffer): New static variable. (pp_warning_buffer): Make it a pointer. (gfc_output_buffer_empty_p): New. (gfc_error_init_1): Call gfc_buffer_error. (gfc_buffer_error): Do not use pp_warning_buffer.flush_p as the buffered_p flag. (gfc_clear_warning): Likewise. (gfc_warning_check): Call gfc_clear_warning. Only check the new pp_warning_buffer if the old warning_buffer was empty. Call diagnostic_action_after_output. (gfc_error_1): Renamed from gfc_error. (gfc_error): New. (gfc_clear_error): Clear also pp_error_buffer. (gfc_error_flag_test): Check also pp_error_buffer. (gfc_error_check): Likewise. Only check the new pp_error_buffer if the old error_buffer was empty. (gfc_move_output_buffer_from_to): New. (gfc_push_error): Use it here. Take also an output_buffer as argument. (gfc_pop_error): Likewise. (gfc_free_error): Likewise. (gfc_diagnostics_init): Use XNEW and placement-new to init pp_error_buffer and pp_warning_buffer. Set flush_p to false for both pp_warning_buffer and pp_error_buffer. * Update gfc_push_error, gfc_pop_error and gfc_free_error calls according to the above changes. * Use gfc_error_1 for all gfc_error calls that use multiple locations. * Use %qs instead of '%s' for many gfc_error calls. From-SVN: r218627
Diffstat (limited to 'gcc/fortran/parse.c')
-rw-r--r--gcc/fortran/parse.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c
index e39a550..970815e 100644
--- a/gcc/fortran/parse.c
+++ b/gcc/fortran/parse.c
@@ -107,13 +107,14 @@ match_word_omp_simd (const char *str, match (*subr) (void), locus *old_locus,
static void
use_modules (void)
{
- gfc_error_buf old_error;
+ gfc_error_buf old_error_1;
+ output_buffer old_error;
- gfc_push_error (&old_error);
+ gfc_push_error (&old_error, &old_error_1);
gfc_buffer_error (false);
gfc_use_modules ();
gfc_buffer_error (true);
- gfc_pop_error (&old_error);
+ gfc_pop_error (&old_error, &old_error_1);
gfc_commit_symbols ();
gfc_warning_check ();
gfc_current_ns->old_cl_list = gfc_current_ns->cl_list;
@@ -2202,7 +2203,7 @@ verify_st_order (st_state *p, gfc_statement st, bool silent)
order:
if (!silent)
- gfc_error ("%s statement at %C cannot follow %s statement at %L",
+ gfc_error_1 ("%s statement at %C cannot follow %s statement at %L",
gfc_ascii_statement (st),
gfc_ascii_statement (p->last_statement), &p->where);
@@ -2579,7 +2580,7 @@ endType:
"subcomponent exists)", c->name, &c->loc, sym->name);
if (sym->attr.lock_comp && coarray && !lock_type)
- gfc_error ("Noncoarray component %s at %L of type LOCK_TYPE or with "
+ gfc_error_1 ("Noncoarray component %s at %L of type LOCK_TYPE or with "
"subcomponent of type LOCK_TYPE must have a codimension or "
"be a subcomponent of a coarray. (Variables of type %s may "
"not have a codimension as %s at %L has a codimension or a "
@@ -3281,7 +3282,7 @@ parse_if_block (void)
case ST_ELSEIF:
if (seen_else)
{
- gfc_error ("ELSE IF statement at %C cannot follow ELSE "
+ gfc_error_1 ("ELSE IF statement at %C cannot follow ELSE "
"statement at %L", &else_locus);
reject_statement ();
@@ -4674,10 +4675,10 @@ gfc_global_used (gfc_gsymbol *sym, locus *where)
}
if (sym->binding_label)
- gfc_error ("Global binding name '%s' at %L is already being used as a %s "
+ gfc_error_1 ("Global binding name '%s' at %L is already being used as a %s "
"at %L", sym->binding_label, where, name, &sym->where);
else
- gfc_error ("Global name '%s' at %L is already being used as a %s at %L",
+ gfc_error_1 ("Global name '%s' at %L is already being used as a %s at %L",
sym->name, where, name, &sym->where);
}