aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/openmp.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/openmp.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/openmp.c')
-rw-r--r--gcc/fortran/openmp.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c
index 3ee0f92..b0309fc 100644
--- a/gcc/fortran/openmp.c
+++ b/gcc/fortran/openmp.c
@@ -2326,31 +2326,31 @@ resolve_omp_clauses (gfc_code *code, locus *where,
{
bool bad = false;
if (n->sym->attr.threadprivate)
- gfc_error ("THREADPRIVATE object '%s' in %s clause at %L",
+ gfc_error ("THREADPRIVATE object %qs in %s clause at %L",
n->sym->name, name, where);
if (n->sym->attr.cray_pointee)
- gfc_error ("Cray pointee '%s' in %s clause at %L",
+ gfc_error ("Cray pointee %qs in %s clause at %L",
n->sym->name, name, where);
if (n->sym->attr.associate_var)
- gfc_error ("ASSOCIATE name '%s' in %s clause at %L",
+ gfc_error ("ASSOCIATE name %qs in %s clause at %L",
n->sym->name, name, where);
if (list != OMP_LIST_PRIVATE)
{
if (n->sym->attr.proc_pointer && list == OMP_LIST_REDUCTION)
- gfc_error ("Procedure pointer '%s' in %s clause at %L",
+ gfc_error ("Procedure pointer %qs in %s clause at %L",
n->sym->name, name, where);
if (n->sym->attr.pointer && list == OMP_LIST_REDUCTION)
- gfc_error ("POINTER object '%s' in %s clause at %L",
+ gfc_error ("POINTER object %qs in %s clause at %L",
n->sym->name, name, where);
if (n->sym->attr.cray_pointer && list == OMP_LIST_REDUCTION)
- gfc_error ("Cray pointer '%s' in %s clause at %L",
+ gfc_error ("Cray pointer %qs in %s clause at %L",
n->sym->name, name, where);
}
if (n->sym->as && n->sym->as->type == AS_ASSUMED_SIZE)
- gfc_error ("Assumed size array '%s' in %s clause at %L",
+ gfc_error ("Assumed size array %qs in %s clause at %L",
n->sym->name, name, where);
if (n->sym->attr.in_namelist && list != OMP_LIST_REDUCTION)
- gfc_error ("Variable '%s' in %s clause is used in "
+ gfc_error ("Variable %qs in %s clause is used in "
"NAMELIST statement at %L",
n->sym->name, name, where);
if (n->sym->attr.pointer && n->sym->attr.intent == INTENT_IN)
@@ -2360,7 +2360,7 @@ resolve_omp_clauses (gfc_code *code, locus *where,
case OMP_LIST_LASTPRIVATE:
case OMP_LIST_LINEAR:
/* case OMP_LIST_REDUCTION: */
- gfc_error ("INTENT(IN) POINTER '%s' in %s clause at %L",
+ gfc_error ("INTENT(IN) POINTER %qs in %s clause at %L",
n->sym->name, name, where);
break;
default:
@@ -2475,10 +2475,10 @@ resolve_omp_clauses (gfc_code *code, locus *where,
break;
case OMP_LIST_LINEAR:
if (n->sym->ts.type != BT_INTEGER)
- gfc_error ("LINEAR variable '%s' must be INTEGER "
+ gfc_error ("LINEAR variable %qs must be INTEGER "
"at %L", n->sym->name, where);
else if (!code && !n->sym->attr.value)
- gfc_error ("LINEAR dummy argument '%s' must have VALUE "
+ gfc_error ("LINEAR dummy argument %qs must have VALUE "
"attribute at %L", n->sym->name, where);
else if (n->expr)
{
@@ -2486,11 +2486,11 @@ resolve_omp_clauses (gfc_code *code, locus *where,
if (!gfc_resolve_expr (expr)
|| expr->ts.type != BT_INTEGER
|| expr->rank != 0)
- gfc_error ("'%s' in LINEAR clause at %L requires "
+ gfc_error ("%qs in LINEAR clause at %L requires "
"a scalar integer linear-step expression",
n->sym->name, where);
else if (!code && expr->expr_type != EXPR_CONSTANT)
- gfc_error ("'%s' in LINEAR clause at %L requires "
+ gfc_error ("%qs in LINEAR clause at %L requires "
"a constant integer linear-step expression",
n->sym->name, where);
}
@@ -2931,7 +2931,7 @@ resolve_omp_atomic (gfc_code *code)
else if (expr_references_sym (arg->expr, var, NULL))
{
gfc_error ("!$OMP ATOMIC intrinsic arguments except one must "
- "not reference '%s' at %L",
+ "not reference %qs at %L",
var->name, &arg->expr->where);
return;
}
@@ -2946,7 +2946,7 @@ resolve_omp_atomic (gfc_code *code)
if (var_arg == NULL)
{
gfc_error ("First or last !$OMP ATOMIC intrinsic argument must "
- "be '%s' at %L", var->name, &expr2->where);
+ "be %qs at %L", var->name, &expr2->where);
return;
}
@@ -3414,7 +3414,7 @@ gfc_resolve_omp_declare_simd (gfc_namespace *ns)
{
if (ods->proc_name != ns->proc_name)
gfc_error ("!$OMP DECLARE SIMD should refer to containing procedure "
- "'%s' at %L", ns->proc_name->name, &ods->where);
+ "%qs at %L", ns->proc_name->name, &ods->where);
if (ods->clauses)
resolve_omp_clauses (NULL, &ods->where, ods->clauses, ns);
}