* [PATCH gfortran] Fix PRs 79602, 79844, 79853, 79859, and 80011.
@ 2017-03-22 15:46 Dominique d'Humières
2017-03-22 16:09 ` Thomas Koenig
0 siblings, 1 reply; 3+ messages in thread
From: Dominique d'Humières @ 2017-03-22 15:46 UTC (permalink / raw)
To: roland.illig; +Cc: GCC-Fortran-ML, GCC-Patches-ML
[-- Attachment #1: Type: text/plain, Size: 786 bytes --]
Th attached patch fixes some of the diagnostic issues reported by Roland Illig. Ok for trunk?
2017-03-22 Dominique d'Humieres <dominiq@lps.ens.fr>
PR fortran/79602
* decl.c: Replace '%s' with %qs.
* expr.c: Likewise.
* interface.c: Likewise.
* match.c: Likewise.
* primary.c: Likewise.
* resolve.c: Likewise.
PR fortran/79844
PR fortran/80011
* io.c: Remove trailing spaces.
* match.c: Likewise.
* openmp.c: Likewise.
* resolve.c: Likewise.
* trans-intrinsic.c: Likewise.
PR fortran/79853
* expr.c: Remove a double spaces.
PR fortran/79859
* primary.c: Remove spurious quotes around %qs.
TIA
Dominique
[-- Attachment #2: patch-79602d --]
[-- Type: application/octet-stream, Size: 13971 bytes --]
diff -up ../_clean/gcc/fortran/decl.c gcc/fortran/decl.c
--- ../_clean/gcc/fortran/decl.c 2017-03-21 17:59:23.000000000 +0100
+++ gcc/fortran/decl.c 2017-03-21 18:42:15.000000000 +0100
@@ -1908,7 +1908,7 @@ build_struct (const char *name, gfc_char
c = gfc_find_component (s->sym, name, true, true, NULL);
if (c != NULL)
{
- gfc_error_now ("Component '%s' at %C already declared at %L",
+ gfc_error_now ("Component %qs at %C already declared at %L",
name, &c->loc);
return false;
}
@@ -3138,7 +3138,7 @@ gfc_match_decl_type_spec (gfc_typespec *
* don't need all the extra derived-type stuff for structures. */
if (gfc_find_symbol (gfc_dt_upper_string (name), NULL, 1, &sym))
{
- gfc_error ("Type name '%s' at %C is ambiguous", name);
+ gfc_error ("Type name %qs at %C is ambiguous", name);
return MATCH_ERROR;
}
if (sym && sym->attr.flavor == FL_STRUCT)
@@ -7578,7 +7578,7 @@ access_attr_decl (gfc_statement st)
if (sym == NULL)
{
gfc_error ("The GENERIC DTIO INTERFACE at %C is not "
- "present in the MODULE '%s'",
+ "present in the MODULE %qs",
gfc_current_ns->proc_name->name);
return MATCH_ERROR;
}
@@ -8595,7 +8595,7 @@ get_struct_decl (const char *name, sym_f
if (sym->components != NULL || sym->attr.zero_comp)
{
- gfc_error ("Type definition of '%s' at %C was already defined at %L",
+ gfc_error ("Type definition of %qs at %C was already defined at %L",
sym->name, &sym->declared_at);
return false;
}
@@ -8748,7 +8748,7 @@ gfc_match_structure_decl (void)
/* Make sure the name is not the name of an intrinsic type. */
if (gfc_is_intrinsic_typename (name))
{
- gfc_error ("Structure name '%s' at %C cannot be the same as an"
+ gfc_error ("Structure name %qs at %C cannot be the same as an"
" intrinsic type", name);
return MATCH_ERROR;
}
diff -up ../_clean/gcc/fortran/expr.c gcc/fortran/expr.c
--- ../_clean/gcc/fortran/expr.c 2017-01-21 11:37:15.000000000 +0100
+++ gcc/fortran/expr.c 2017-03-12 18:27:44.000000000 +0100
@@ -2321,7 +2321,7 @@ check_inquiry (gfc_expr *e, int not_rest
|| ap->expr->symtree->n.sym->ts.deferred))
{
gfc_error ("Assumed or deferred character length variable %qs "
- " in constant expression at %L",
+ "in constant expression at %L",
ap->expr->symtree->n.sym->name,
&ap->expr->where);
return MATCH_ERROR;
@@ -2792,7 +2792,7 @@ external_spec_function (gfc_expr *e)
/* F08:7.1.11.6. */
if (f->attr.recursive
&& !gfc_notify_std (GFC_STD_F2003,
- "Specification function '%s' "
+ "Specification function %qs "
"at %L cannot be RECURSIVE", f->name, &e->where))
return false;
@@ -3591,7 +3591,7 @@ gfc_check_pointer_assign (gfc_expr *lval
if (!s1 && comp1 && comp1->attr.subroutine && s2 && s2->attr.function)
{
gfc_error ("Interface mismatch in procedure pointer assignment "
- "at %L: '%s' is not a subroutine", &rvalue->where, name);
+ "at %L: %qs is not a subroutine", &rvalue->where, name);
return false;
}
diff -up ../_clean/gcc/fortran/interface.c gcc/fortran/interface.c
--- ../_clean/gcc/fortran/interface.c 2017-02-25 00:41:17.000000000 +0100
+++ gcc/fortran/interface.c 2017-03-12 18:27:44.000000000 +0100
@@ -4694,7 +4694,7 @@ check_dtio_interface1 (gfc_symbol *deriv
gcc_assert (dtio_sub);
if (!dtio_sub->attr.subroutine)
- gfc_error ("DTIO procedure '%s' at %L must be a subroutine",
+ gfc_error ("DTIO procedure %qs at %L must be a subroutine",
dtio_sub->name, &dtio_sub->declared_at);
arg_num = 0;
@@ -4703,14 +4703,14 @@ check_dtio_interface1 (gfc_symbol *deriv
if (arg_num < (formatted ? 6 : 4))
{
- gfc_error ("Too few dummy arguments in DTIO procedure '%s' at %L",
+ gfc_error ("Too few dummy arguments in DTIO procedure %qs at %L",
dtio_sub->name, &dtio_sub->declared_at);
return;
}
if (arg_num > (formatted ? 6 : 4))
{
- gfc_error ("Too many dummy arguments in DTIO procedure '%s' at %L",
+ gfc_error ("Too many dummy arguments in DTIO procedure %qs at %L",
dtio_sub->name, &dtio_sub->declared_at);
return;
}
diff -up ../_clean/gcc/fortran/io.c gcc/fortran/io.c
--- ../_clean/gcc/fortran/io.c 2017-01-01 17:39:01.000000000 +0100
+++ gcc/fortran/io.c 2017-03-12 18:27:44.000000000 +0100
@@ -3837,7 +3837,7 @@ if (condition) \
io_constraint (unformatted && dt->namelist == NULL,
"DELIM= specifier at %L must be with FMT=* or "
- "NML= specifier ", &dt->delim->where);
+ "NML= specifier", &dt->delim->where);
}
}
diff -up ../_clean/gcc/fortran/match.c gcc/fortran/match.c
--- ../_clean/gcc/fortran/match.c 2017-03-05 12:42:24.000000000 +0100
+++ gcc/fortran/match.c 2017-03-12 18:27:44.000000000 +0100
@@ -221,7 +221,7 @@ gfc_match_member_sep(gfc_symbol *sym)
if (c)
goto yes;
- gfc_error ("'%s' is neither a defined operator nor a "
+ gfc_error ("%qs is neither a defined operator nor a "
"structure component in dotted string at %C", name);
goto error;
}
@@ -3141,7 +3141,7 @@ event_statement (gfc_statement st)
{
if (saw_stat)
{
- gfc_error ("Redundant STAT tag found at %L ", &tmp->where);
+ gfc_error ("Redundant STAT tag found at %L", &tmp->where);
goto cleanup;
}
stat = tmp;
@@ -3162,7 +3162,7 @@ event_statement (gfc_statement st)
{
if (saw_errmsg)
{
- gfc_error ("Redundant ERRMSG tag found at %L ", &tmp->where);
+ gfc_error ("Redundant ERRMSG tag found at %L", &tmp->where);
goto cleanup;
}
errmsg = tmp;
@@ -3183,7 +3183,7 @@ event_statement (gfc_statement st)
{
if (saw_until_count)
{
- gfc_error ("Redundant UNTIL_COUNT tag found at %L ",
+ gfc_error ("Redundant UNTIL_COUNT tag found at %L",
&tmp->where);
goto cleanup;
}
@@ -3358,7 +3358,7 @@ lock_unlock_statement (gfc_statement st)
{
if (saw_stat)
{
- gfc_error ("Redundant STAT tag found at %L ", &tmp->where);
+ gfc_error ("Redundant STAT tag found at %L", &tmp->where);
goto cleanup;
}
stat = tmp;
@@ -3379,7 +3379,7 @@ lock_unlock_statement (gfc_statement st)
{
if (saw_errmsg)
{
- gfc_error ("Redundant ERRMSG tag found at %L ", &tmp->where);
+ gfc_error ("Redundant ERRMSG tag found at %L", &tmp->where);
goto cleanup;
}
errmsg = tmp;
@@ -3400,7 +3400,7 @@ lock_unlock_statement (gfc_statement st)
{
if (saw_acq_lock)
{
- gfc_error ("Redundant ACQUIRED_LOCK tag found at %L ",
+ gfc_error ("Redundant ACQUIRED_LOCK tag found at %L",
&tmp->where);
goto cleanup;
}
@@ -3570,7 +3570,7 @@ sync_statement (gfc_statement st)
{
if (saw_stat)
{
- gfc_error ("Redundant STAT tag found at %L ", &tmp->where);
+ gfc_error ("Redundant STAT tag found at %L", &tmp->where);
goto cleanup;
}
stat = tmp;
@@ -3590,7 +3590,7 @@ sync_statement (gfc_statement st)
{
if (saw_errmsg)
{
- gfc_error ("Redundant ERRMSG tag found at %L ", &tmp->where);
+ gfc_error ("Redundant ERRMSG tag found at %L", &tmp->where);
goto cleanup;
}
errmsg = tmp;
@@ -4080,7 +4080,7 @@ alloc_opt_list:
/* Enforce C630. */
if (saw_stat)
{
- gfc_error ("Redundant STAT tag found at %L ", &tmp->where);
+ gfc_error ("Redundant STAT tag found at %L", &tmp->where);
goto cleanup;
}
@@ -4106,7 +4106,7 @@ alloc_opt_list:
/* Enforce C630. */
if (saw_errmsg)
{
- gfc_error ("Redundant ERRMSG tag found at %L ", &tmp->where);
+ gfc_error ("Redundant ERRMSG tag found at %L", &tmp->where);
goto cleanup;
}
@@ -4129,7 +4129,7 @@ alloc_opt_list:
/* Enforce C630. */
if (saw_source)
{
- gfc_error ("Redundant SOURCE tag found at %L ", &tmp->where);
+ gfc_error ("Redundant SOURCE tag found at %L", &tmp->where);
goto cleanup;
}
@@ -4166,7 +4166,7 @@ alloc_opt_list:
/* Check F08:C636. */
if (saw_mold)
{
- gfc_error ("Redundant MOLD tag found at %L ", &tmp->where);
+ gfc_error ("Redundant MOLD tag found at %L", &tmp->where);
goto cleanup;
}
@@ -4417,7 +4417,7 @@ dealloc_opt_list:
{
if (saw_stat)
{
- gfc_error ("Redundant STAT tag found at %L ", &tmp->where);
+ gfc_error ("Redundant STAT tag found at %L", &tmp->where);
gfc_free_expr (tmp);
goto cleanup;
}
@@ -4442,7 +4442,7 @@ dealloc_opt_list:
if (saw_errmsg)
{
- gfc_error ("Redundant ERRMSG tag found at %L ", &tmp->where);
+ gfc_error ("Redundant ERRMSG tag found at %L", &tmp->where);
gfc_free_expr (tmp);
goto cleanup;
}
diff -up ../_clean/gcc/fortran/module.c gcc/fortran/module.c
--- ../_clean/gcc/fortran/module.c 2017-03-18 13:48:04.000000000 +0100
+++ gcc/fortran/module.c 2017-03-19 11:05:35.000000000 +0100
@@ -676,7 +676,7 @@ gfc_match_use (void)
|| strcmp (new_use->local_name, use_list->module_name) == 0)
{
gfc_error ("The name %qs at %C has already been used as "
- "an external module name.", use_list->module_name);
+ "an external module name", use_list->module_name);
goto cleanup;
}
break;
diff -up ../_clean/gcc/fortran/openmp.c gcc/fortran/openmp.c
--- ../_clean/gcc/fortran/openmp.c 2017-03-17 19:43:02.000000000 +0100
+++ gcc/fortran/openmp.c 2017-03-19 11:05:35.000000000 +0100
@@ -3855,7 +3855,7 @@ resolve_omp_udr_callback2 (gfc_expr **e,
if (!sym->attr.intrinsic
&& sym->attr.if_source == IFSRC_UNKNOWN)
gfc_error ("Implicitly declared function %s used in "
- "!$OMP DECLARE REDUCTION at %L ", sym->name, &(*e)->where);
+ "!$OMP DECLARE REDUCTION at %L", sym->name, &(*e)->where);
}
return 0;
}
@@ -3904,7 +3904,7 @@ resolve_omp_udr_clause (gfc_omp_namelist
&& !sym->attr.intrinsic
&& sym->attr.if_source == IFSRC_UNKNOWN)
gfc_error ("Implicitly declared subroutine %s used in "
- "!$OMP DECLARE REDUCTION at %L ", sym->name,
+ "!$OMP DECLARE REDUCTION at %L", sym->name,
©->loc);
}
gfc_code_walker (©, gfc_dummy_code_callback,
diff -up ../_clean/gcc/fortran/primary.c gcc/fortran/primary.c
--- ../_clean/gcc/fortran/primary.c 2017-01-21 11:37:15.000000000 +0100
+++ gcc/fortran/primary.c 2017-03-12 18:27:44.000000000 +0100
@@ -1555,7 +1555,7 @@ match_actual_arg (gfc_expr **result)
gfc_set_sym_referenced (sym);
if (sym->attr.flavor == FL_NAMELIST)
{
- gfc_error ("Namelist '%s' can not be an argument at %L",
+ gfc_error ("Namelist %qs can not be an argument at %L",
sym->name, &where);
break;
}
@@ -2670,7 +2670,7 @@ build_actual_constructor (gfc_structure_
&& CLASS_DATA (comp)->attr.allocatable))
{
if (!gfc_notify_std (GFC_STD_F2008, "No initializer for "
- "allocatable component '%qs' given in the "
+ "allocatable component %qs given in the "
"structure constructor at %C", comp->name))
return false;
}
@@ -3571,7 +3571,7 @@ match_variable (gfc_expr **result, int e
&& (dt_sym = gfc_find_dt_in_generic (sym)))
{
if (dt_sym->attr.flavor == FL_DERIVED)
- gfc_error ("Derived type '%s' cannot be used as a variable at %C",
+ gfc_error ("Derived type %qs cannot be used as a variable at %C",
sym->name);
return MATCH_ERROR;
}
diff -up ../_clean/gcc/fortran/resolve.c gcc/fortran/resolve.c
--- ../_clean/gcc/fortran/resolve.c 2017-03-15 19:25:37.000000000 +0100
+++ gcc/fortran/resolve.c 2017-03-17 00:17:41.000000000 +0100
@@ -1342,7 +1342,7 @@ resolve_structure_cons (gfc_expr *expr,
{
t = false;
gfc_error ("Pointer initialization target at %L "
- "must not be ALLOCATABLE ", &cons->expr->where);
+ "must not be ALLOCATABLE", &cons->expr->where);
}
if (!a.save)
{
@@ -2469,7 +2469,7 @@ resolve_global_procedure (gfc_symbol *sy
{
gfc_error_opt (OPT_Wargument_mismatch,
"Interface mismatch in global procedure %qs at %L:"
- " %s ", sym->name, &sym->declared_at, reason);
+ " %s", sym->name, &sym->declared_at, reason);
goto done;
}
@@ -12345,8 +12345,8 @@ resolve_fl_procedure (gfc_symbol *sym, i
if (!gfc_check_result_characteristics (sym, iface, errmsg, 200))
{
gfc_error ("%s between the MODULE PROCEDURE declaration "
- "in MODULE '%s' and the declaration at %L in "
- "(SUB)MODULE '%s'",
+ "in MODULE %qs and the declaration at %L in "
+ "(SUB)MODULE %qs",
errmsg, module_name, &sym->declared_at,
submodule_name ? submodule_name : module_name);
return false;
@@ -14729,7 +14729,7 @@ resolve_symbol (gfc_symbol *sym)
for (; formal; formal = formal->next)
if (formal->sym && formal->sym->attr.flavor == FL_NAMELIST)
{
- gfc_error ("Namelist '%s' can not be an argument to "
+ gfc_error ("Namelist %qs can not be an argument to "
"subroutine or function at %L",
formal->sym->name, &sym->declared_at);
return;
diff -up ../_clean/gcc/fortran/trans-intrinsic.c gcc/fortran/trans-intrinsic.c
--- ../_clean/gcc/fortran/trans-intrinsic.c 2017-03-05 12:42:24.000000000 +0100
+++ gcc/fortran/trans-intrinsic.c 2017-03-12 18:27:44.000000000 +0100
@@ -10229,7 +10229,7 @@ conv_intrinsic_event_query (gfc_code *co
if (gfc_is_coindexed (event_expr))
{
- gfc_error ("The event variable at %L shall not be coindexed ",
+ gfc_error ("The event variable at %L shall not be coindexed",
&event_expr->where);
return NULL_TREE;
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH gfortran] Fix PRs 79602, 79844, 79853, 79859, and 80011.
2017-03-22 15:46 [PATCH gfortran] Fix PRs 79602, 79844, 79853, 79859, and 80011 Dominique d'Humières
@ 2017-03-22 16:09 ` Thomas Koenig
2017-03-22 16:40 ` Dominique d'Humières
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Koenig @ 2017-03-22 16:09 UTC (permalink / raw)
To: Dominique d'Humières, roland.illig
Cc: GCC-Fortran-ML, GCC-Patches-ML
Hi Dominique,
> Th attached patch fixes some of the diagnostic issues reported by Roland Illig. Ok for trunk?
Yes, OK. Thanks for the patch!
Regards
Thomas
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH gfortran] Fix PRs 79602, 79844, 79853, 79859, and 80011.
2017-03-22 16:09 ` Thomas Koenig
@ 2017-03-22 16:40 ` Dominique d'Humières
0 siblings, 0 replies; 3+ messages in thread
From: Dominique d'Humières @ 2017-03-22 16:40 UTC (permalink / raw)
To: Thomas Koenig; +Cc: roland.illig, GCC-Fortran-ML, GCC-Patches-ML
Committed as revision r246391.
Thanks for the quick review.
Dominique
> Le 22 mars 2017 à 17:08, Thomas Koenig <tkoenig@netcologne.de> a écrit :
>
> Hi Dominique,
>
>> Th attached patch fixes some of the diagnostic issues reported by Roland Illig. Ok for trunk?
>
> Yes, OK. Thanks for the patch!
>
> Regards
>
> Thomas
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-03-22 16:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-22 15:46 [PATCH gfortran] Fix PRs 79602, 79844, 79853, 79859, and 80011 Dominique d'Humières
2017-03-22 16:09 ` Thomas Koenig
2017-03-22 16:40 ` Dominique d'Humières
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).