* Re: How to add %' into gfc_fatal_error
2019-03-11 17:23 ` Steve Kargl
@ 2019-03-12 11:15 ` Martin Liška
2019-03-12 14:17 ` Steve Kargl
0 siblings, 1 reply; 8+ messages in thread
From: Martin Liška @ 2019-03-12 11:15 UTC (permalink / raw)
To: sgk, David Malcolm
Cc: GCC Development, Martin Sebor, fortran, GCC Patches, Alexander Monakov
[-- Attachment #1: Type: text/plain, Size: 1198 bytes --]
On 3/11/19 6:23 PM, Steve Kargl wrote:
> On Mon, Mar 11, 2019 at 12:07:55PM -0400, David Malcolm wrote:
>> On Mon, 2019-03-11 at 15:18 +0100, Martin Liška wrote:
>>> Hi.
>>>
>>> I would like to add %' into __gcc_gfc__ in order to handle:
>>>
>>> ./xgcc -B. /tmp/module.ii -Wformat -c
>>> /home/marxin/Programming/gcc/gcc/fortran/module.c: In function âvoid
>>> dump_module(const char*, int)â:
>>> /home/marxin/Programming/gcc/gcc/fortran/module.c:6205:19: warning:
>>> unknown conversion type character â'â in format [-Wformat=]
>>> 6205 | gfc_fatal_error ("Can%'t delete module file %qs: %s",
>>> filename,
>>> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>
>>> Can you please help me how to do that?
>
> Are you inserting "%" in front of "'"? Why?
> There are 18 occurences of "Can't" in gfc_error*
> messages in the fortran/*.c code. If you're going
> to touch all 18 locations, then change "Can't" to
> "Cannot".
>
Hi.
I'm addressing that with attached patch. The patch also touches Alexander's
note in a next email (i386.c change).
Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
Ready to be installed?
Thanks,
Martin
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Replace-can-t-in-error-messages-for-Fortran.patch --]
[-- Type: text/x-patch; name="0001-Replace-can-t-in-error-messages-for-Fortran.patch", Size: 30699 bytes --]
From 5903e4750fd5fd8e972cc5c69513ad724e8eb949 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Tue, 12 Mar 2019 09:39:07 +0100
Subject: [PATCH] Replace can't in error messages for Fortran.
gcc/c-family/ChangeLog:
2019-03-12 Martin Liska <mliska@suse.cz>
* c-opts.c (c_common_handle_option): Wrap option with %< and %>.
gcc/fortran/ChangeLog:
2019-03-12 Martin Liska <mliska@suse.cz>
* decl.c (add_init_expr_to_sym): Replace usage of 'can't'
with 'cannot'.
(variable_decl): Likewise.
(cray_pointer_decl): Likewise.
(match_binding_attributes): Likewise.
* f95-lang.c (gfc_init): Likewise.
* interface.c (gfc_check_typebound_override): Likewise.
* intrinsic.c (make_generic): Likewise.
* module.c (dump_module): Likewise.
(gfc_use_module): Likewise.
* primary.c (gfc_convert_to_structure_constructor): Likewise.
* resolve.c (resolve_entries): Likewise.
(check_generic_tbp_ambiguity): Likewise.
(get_checked_tb_operator_target): Likewise.
* scanner.c (load_file): Likewise.
* trans-expr.c (gfc_conv_intrinsic_to_class): Likewise.
gcc/ChangeLog:
2019-03-12 Martin Liska <mliska@suse.cz>
* config/i386/i386.c: Reword an error message.
gcc/testsuite/ChangeLog:
2019-03-12 Martin Liska <mliska@suse.cz>
* gfortran.dg/abstract_type_3.f03: Amend test-case scan
patterns.
* gfortran.dg/binding_label_tests_4.f03: Likewise.
* gfortran.dg/c_f_pointer_tests_6.f90: Likewise.
* gfortran.dg/c_funloc_tests_6.f90: Likewise.
* gfortran.dg/c_loc_tests_17.f90: Likewise.
* gfortran.dg/constructor_9.f90: Likewise.
* gfortran.dg/dec_structure_8.f90: Likewise.
* gfortran.dg/entry_4.f90: Likewise.
* gfortran.dg/init_char_with_nonchar_ctr.f90: Likewise.
* gfortran.dg/initialization_23.f90: Likewise.
* gfortran.dg/logical_assignment_1.f90: Likewise.
* gfortran.dg/pr80752.f90: Likewise.
* gfortran.dg/pr88116_1.f90: Likewise.
* gfortran.dg/pr88467.f90: Likewise.
* gfortran.dg/typebound_call_7.f03: Likewise.
* gfortran.dg/typebound_generic_1.f03: Likewise.
* gfortran.dg/typebound_operator_2.f03: Likewise.
* gfortran.dg/typebound_operator_4.f03: Likewise.
* gfortran.dg/typebound_proc_9.f03: Likewise.
* gfortran.dg/unlimited_polymorphic_2.f03: Likewise.
---
gcc/c-family/c-opts.c | 2 +-
gcc/config/i386/i386.c | 3 ++-
gcc/fortran/decl.c | 10 +++++-----
gcc/fortran/f95-lang.c | 2 +-
gcc/fortran/interface.c | 2 +-
gcc/fortran/intrinsic.c | 8 ++++----
gcc/fortran/module.c | 14 +++++++-------
gcc/fortran/primary.c | 2 +-
gcc/fortran/resolve.c | 18 +++++++++---------
gcc/fortran/scanner.c | 2 +-
gcc/fortran/trans-expr.c | 4 ++--
gcc/testsuite/gfortran.dg/abstract_type_3.f03 | 2 +-
.../gfortran.dg/binding_label_tests_4.f03 | 2 +-
.../gfortran.dg/c_f_pointer_tests_6.f90 | 2 +-
gcc/testsuite/gfortran.dg/c_funloc_tests_6.f90 | 4 ++--
gcc/testsuite/gfortran.dg/c_loc_tests_17.f90 | 2 +-
gcc/testsuite/gfortran.dg/constructor_9.f90 | 2 +-
gcc/testsuite/gfortran.dg/dec_structure_8.f90 | 2 +-
gcc/testsuite/gfortran.dg/entry_4.f90 | 8 ++++----
.../gfortran.dg/init_char_with_nonchar_ctr.f90 | 8 ++++----
.../gfortran.dg/initialization_23.f90 | 2 +-
.../gfortran.dg/logical_assignment_1.f90 | 2 +-
gcc/testsuite/gfortran.dg/pr80752.f90 | 2 +-
gcc/testsuite/gfortran.dg/pr88116_1.f90 | 2 +-
gcc/testsuite/gfortran.dg/pr88467.f90 | 2 +-
gcc/testsuite/gfortran.dg/typebound_call_7.f03 | 2 +-
.../gfortran.dg/typebound_generic_1.f03 | 4 ++--
.../gfortran.dg/typebound_operator_2.f03 | 4 ++--
.../gfortran.dg/typebound_operator_4.f03 | 4 ++--
gcc/testsuite/gfortran.dg/typebound_proc_9.f03 | 2 +-
.../gfortran.dg/unlimited_polymorphic_2.f03 | 2 +-
31 files changed, 64 insertions(+), 63 deletions(-)
diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c
index daa02a5e72d..454cfa0ee3e 100644
--- a/gcc/c-family/c-opts.c
+++ b/gcc/c-family/c-opts.c
@@ -324,7 +324,7 @@ c_common_handle_option (size_t scode, const char *arg, HOST_WIDE_INT value,
else
{
if (quote_chain_split)
- error ("-I- specified twice");
+ error ("%<-I-%> specified twice");
quote_chain_split = true;
split_quote_chain ();
inform (input_location, "obsolete option %<-I-%> used, "
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 896c6f33d40..fe459071aaf 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -38375,7 +38375,8 @@ rdseed_step:
mode0 = insn_data[icode].operand[0].mode;
if (!insn_data[icode].operand[0].predicate (op0, mode0))
{
- error ("xabort argument must be an 8-bit immediate");
+ error ("the argument to %<xabort%> intrinsic must "
+ "be an 8-bit immediate");
return const0_rtx;
}
emit_insn (gen_xabort (op0));
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index a29e2db0bd6..f6411f14875 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -1978,7 +1978,7 @@ add_init_expr_to_sym (const char *name, gfc_expr **initp, locus *var_locus)
if (init->rank == 0)
{
- gfc_error ("Can't initialize implied-shape array at %L"
+ gfc_error ("Cannot initialize implied-shape array at %L"
" with scalar", &sym->declared_at);
return false;
}
@@ -2490,7 +2490,7 @@ variable_decl (int elem)
if (as->type == AS_IMPLIED_SHAPE && current_attr.flavor != FL_PARAMETER)
{
m = MATCH_ERROR;
- gfc_error ("Non-PARAMETER symbol %qs at %L can't be implied-shape",
+ gfc_error ("Non-PARAMETER symbol %qs at %L cannot be implied-shape",
name, &var_locus);
goto cleanup;
}
@@ -2668,7 +2668,7 @@ variable_decl (int elem)
else
{
if (!gfc_set_array_spec (sym, cp_as, &var_locus))
- gfc_internal_error ("Couldn't set pointee array spec.");
+ gfc_internal_error ("Cannot set pointee array spec.");
/* Fix the array spec. */
m = gfc_mod_pointee_as (sym->as);
@@ -8538,7 +8538,7 @@ cray_pointer_decl (void)
if (cpte->as == NULL)
{
if (!gfc_set_array_spec (cpte, as, &var_locus))
- gfc_internal_error ("Couldn't set Cray pointee array spec.");
+ gfc_internal_error ("Cannot set Cray pointee array spec.");
}
else if (as != NULL)
{
@@ -10706,7 +10706,7 @@ match_binding_attributes (gfc_typebound_proc* ba, bool generic, bool ppc)
/* NON_OVERRIDABLE and DEFERRED exclude themselves. */
if (ba->non_overridable && ba->deferred)
{
- gfc_error ("NON_OVERRIDABLE and DEFERRED can't both appear at %C");
+ gfc_error ("NON_OVERRIDABLE and DEFERRED cannot both appear at %C");
goto error;
}
diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c
index ad81f7d93a0..3e3d3046bdb 100644
--- a/gcc/fortran/f95-lang.c
+++ b/gcc/fortran/f95-lang.c
@@ -248,7 +248,7 @@ gfc_init (void)
gfc_init_1 ();
if (!gfc_new_file ())
- fatal_error (input_location, "can't open input file: %s", gfc_source_file);
+ fatal_error (input_location, "cannot open input file: %s", gfc_source_file);
if (flag_preprocess_only)
return false;
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
index a07e658db88..c9781d7b9f8 100644
--- a/gcc/fortran/interface.c
+++ b/gcc/fortran/interface.c
@@ -4552,7 +4552,7 @@ gfc_check_typebound_override (gfc_symtree* proc, gfc_symtree* old)
/* If the overwritten procedure is GENERIC, this is an error. */
if (old->n.tb->is_generic)
{
- gfc_error ("Can't overwrite GENERIC %qs at %L",
+ gfc_error ("Cannot overwrite GENERIC %qs at %L",
old->name, &proc->n.tb->where);
return false;
}
diff --git a/gcc/fortran/intrinsic.c b/gcc/fortran/intrinsic.c
index 4797b3d95cf..c21fbddd5fb 100644
--- a/gcc/fortran/intrinsic.c
+++ b/gcc/fortran/intrinsic.c
@@ -1157,7 +1157,7 @@ make_generic (const char *name, gfc_isym_id id, int standard ATTRIBUTE_UNUSED)
g = gfc_find_function (name);
if (g == NULL)
- gfc_internal_error ("make_generic(): Can't find generic symbol %qs",
+ gfc_internal_error ("make_generic(): Cannot find generic symbol %qs",
name);
gcc_assert (g->id == id);
@@ -4217,7 +4217,7 @@ keywords:
gfc_error ("The argument list functions %%VAL, %%LOC or %%REF "
"are not allowed in this context at %L", where);
else
- gfc_error ("Can't find keyword named %qs in call to %qs at %L",
+ gfc_error ("Cannot find keyword named %qs in call to %qs at %L",
a->name, name, where);
return false;
}
@@ -5179,12 +5179,12 @@ gfc_convert_type_warn (gfc_expr *expr, gfc_typespec *ts, int eflag, int wflag)
bad:
if (eflag == 1)
{
- gfc_error ("Can't convert %s to %s at %L",
+ gfc_error ("Cannot convert %s to %s at %L",
gfc_typename (&from_ts), gfc_typename (ts), &expr->where);
return false;
}
- gfc_internal_error ("Can't convert %qs to %qs at %L",
+ gfc_internal_error ("Cannot convert %qs to %qs at %L",
gfc_typename (&from_ts), gfc_typename (ts),
&expr->where);
/* Not reached */
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c
index 320b30c529a..0572b8e02c1 100644
--- a/gcc/fortran/module.c
+++ b/gcc/fortran/module.c
@@ -6170,7 +6170,7 @@ dump_module (const char *name, int dump_flag)
/* Write the module to the temporary file. */
module_fp = gzopen (filename_tmp, "w");
if (module_fp == NULL)
- gfc_fatal_error ("Can't open module file %qs for writing at %C: %s",
+ gfc_fatal_error ("Cannot open module file %qs for writing at %C: %s",
filename_tmp, xstrerror (errno));
/* Use lbasename to ensure module files are reproducible regardless
@@ -6202,16 +6202,16 @@ dump_module (const char *name, int dump_flag)
{
/* Module file have changed, replace the old one. */
if (remove (filename) && errno != ENOENT)
- gfc_fatal_error ("Can't delete module file %qs: %s", filename,
+ gfc_fatal_error ("Cannot delete module file %qs: %s", filename,
xstrerror (errno));
if (rename (filename_tmp, filename))
- gfc_fatal_error ("Can't rename module file %qs to %qs: %s",
+ gfc_fatal_error ("Cannot rename module file %qs to %qs: %s",
filename_tmp, filename, xstrerror (errno));
}
else
{
if (remove (filename_tmp))
- gfc_fatal_error ("Can't delete temporary module file %qs: %s",
+ gfc_fatal_error ("Cannot delete temporary module file %qs: %s",
filename_tmp, xstrerror (errno));
}
}
@@ -7000,7 +7000,7 @@ gfc_use_module (gfc_use_list *module)
module_fp = gzopen_intrinsic_module (filename);
if (module_fp == NULL && module->intrinsic)
- gfc_fatal_error ("Can't find an intrinsic module named %qs at %C",
+ gfc_fatal_error ("Cannot find an intrinsic module named %qs at %C",
module_name);
/* Check for the IEEE modules, so we can mark their symbols
@@ -7028,7 +7028,7 @@ gfc_use_module (gfc_use_list *module)
{
if (gfc_state_stack->state != COMP_SUBMODULE
&& module->submodule_name == NULL)
- gfc_fatal_error ("Can't open module file %qs for reading at %C: %s",
+ gfc_fatal_error ("Cannot open module file %qs for reading at %C: %s",
filename, xstrerror (errno));
else
gfc_fatal_error ("Module file %qs has not been generated, either "
@@ -7088,7 +7088,7 @@ gfc_use_module (gfc_use_list *module)
for (p = gfc_state_stack; p; p = p->previous)
if ((p->state == COMP_MODULE || p->state == COMP_SUBMODULE)
&& strcmp (p->sym->name, module_name) == 0)
- gfc_fatal_error ("Can't USE the same %smodule we're building",
+ gfc_fatal_error ("Cannot USE the same %smodule we're building",
p->state == COMP_SUBMODULE ? "sub" : "");
init_pi_tree ();
diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c
index 5bfb90c5dec..e918372ef85 100644
--- a/gcc/fortran/primary.c
+++ b/gcc/fortran/primary.c
@@ -2979,7 +2979,7 @@ gfc_convert_to_structure_constructor (gfc_expr *e, gfc_symbol *sym, gfc_expr **c
if (!parent && sym->attr.abstract)
{
- gfc_error ("Can't construct ABSTRACT type %qs at %L",
+ gfc_error ("Cannot construct ABSTRACT type %qs at %L",
sym->name, &expr->where);
goto cleanup;
}
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 1cf9cbae964..6677deb3bdc 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -838,22 +838,22 @@ resolve_entries (gfc_namespace *ns)
if (sym->attr.dimension)
{
if (el == ns->entries)
- gfc_error ("FUNCTION result %s can't be an array in "
+ gfc_error ("FUNCTION result %s cannot be an array in "
"FUNCTION %s at %L", sym->name,
ns->entries->sym->name, &sym->declared_at);
else
- gfc_error ("ENTRY result %s can't be an array in "
+ gfc_error ("ENTRY result %s cannot be an array in "
"FUNCTION %s at %L", sym->name,
ns->entries->sym->name, &sym->declared_at);
}
else if (sym->attr.pointer)
{
if (el == ns->entries)
- gfc_error ("FUNCTION result %s can't be a POINTER in "
+ gfc_error ("FUNCTION result %s cannot be a POINTER in "
"FUNCTION %s at %L", sym->name,
ns->entries->sym->name, &sym->declared_at);
else
- gfc_error ("ENTRY result %s can't be a POINTER in "
+ gfc_error ("ENTRY result %s cannot be a POINTER in "
"FUNCTION %s at %L", sym->name,
ns->entries->sym->name, &sym->declared_at);
}
@@ -891,12 +891,12 @@ resolve_entries (gfc_namespace *ns)
if (sym)
{
if (el == ns->entries)
- gfc_error ("FUNCTION result %s can't be of type %s "
+ gfc_error ("FUNCTION result %s cannot be of type %s "
"in FUNCTION %s at %L", sym->name,
gfc_typename (ts), ns->entries->sym->name,
&sym->declared_at);
else
- gfc_error ("ENTRY result %s can't be of type %s "
+ gfc_error ("ENTRY result %s cannot be of type %s "
"in FUNCTION %s at %L", sym->name,
gfc_typename (ts), ns->entries->sym->name,
&sym->declared_at);
@@ -13115,7 +13115,7 @@ check_generic_tbp_ambiguity (gfc_tbp_generic* t1, gfc_tbp_generic* t2,
if (sym1->attr.subroutine != sym2->attr.subroutine
|| sym1->attr.function != sym2->attr.function)
{
- gfc_error ("%qs and %qs can't be mixed FUNCTION/SUBROUTINE for"
+ gfc_error ("%qs and %qs cannot be mixed FUNCTION/SUBROUTINE for"
" GENERIC %qs at %L",
sym1->name, sym2->name, generic_name, &where);
return false;
@@ -13250,7 +13250,7 @@ specific_found:
/* If we attempt to "overwrite" a specific binding, this is an error. */
if (p->overridden && !p->overridden->is_generic)
{
- gfc_error ("GENERIC %qs at %L can't overwrite specific binding with"
+ gfc_error ("GENERIC %qs at %L cannot overwrite specific binding with"
" the same name", name, &p->where);
return false;
}
@@ -13306,7 +13306,7 @@ get_checked_tb_operator_target (gfc_tbp_generic* target, locus where)
/* F08:C468. All operator bindings must have a passed-object dummy argument. */
if (target->specific->nopass)
{
- gfc_error ("Type-bound operator at %L can't be NOPASS", &where);
+ gfc_error ("Type-bound operator at %L cannot be NOPASS", &where);
return NULL;
}
diff --git a/gcc/fortran/scanner.c b/gcc/fortran/scanner.c
index 08e4521a86d..eeba2ab2ae7 100644
--- a/gcc/fortran/scanner.c
+++ b/gcc/fortran/scanner.c
@@ -2469,7 +2469,7 @@ load_file (const char *realfilename, const char *displayedname, bool initial)
if (input == NULL)
{
- gfc_error_now ("Can't open file %qs", filename);
+ gfc_error_now ("Cannot open file %qs", filename);
return false;
}
}
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 07027139d04..8f32407b165 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -926,8 +926,8 @@ gfc_conv_intrinsic_to_class (gfc_se *parmse, gfc_expr *e,
}
else
{
- gfc_error ("Can't compute the length of the char array at %L.",
- &e->where);
+ gfc_error ("Cannot compute the length of the char array "
+ "at %L.", &e->where);
}
}
}
diff --git a/gcc/testsuite/gfortran.dg/abstract_type_3.f03 b/gcc/testsuite/gfortran.dg/abstract_type_3.f03
index e7a9d9b6357..542037397ab 100644
--- a/gcc/testsuite/gfortran.dg/abstract_type_3.f03
+++ b/gcc/testsuite/gfortran.dg/abstract_type_3.f03
@@ -41,7 +41,7 @@ CONTAINS
SUBROUTINE sub (arg) ! { dg-error "is of the ABSTRACT type 'again_abst_t'" }
IMPLICIT NONE
TYPE(again_abst_t) :: arg
- arg = again_abst_t () ! { dg-error "Can't construct ABSTRACT type 'again_abst_t'" }
+ arg = again_abst_t () ! { dg-error "Cannot construct ABSTRACT type 'again_abst_t'" }
END SUBROUTINE sub
SUBROUTINE impl ()
diff --git a/gcc/testsuite/gfortran.dg/binding_label_tests_4.f03 b/gcc/testsuite/gfortran.dg/binding_label_tests_4.f03
index 7214289c976..f8c0f046063 100644
--- a/gcc/testsuite/gfortran.dg/binding_label_tests_4.f03
+++ b/gcc/testsuite/gfortran.dg/binding_label_tests_4.f03
@@ -18,6 +18,6 @@ end module B
module C
use A
-use B ! { dg-error "Can't open module file" }
+use B ! { dg-error "Cannot open module file" }
end module C
! { dg-excess-errors "compilation terminated" }
diff --git a/gcc/testsuite/gfortran.dg/c_f_pointer_tests_6.f90 b/gcc/testsuite/gfortran.dg/c_f_pointer_tests_6.f90
index 6dc439770d4..23ca88b0de0 100644
--- a/gcc/testsuite/gfortran.dg/c_f_pointer_tests_6.f90
+++ b/gcc/testsuite/gfortran.dg/c_f_pointer_tests_6.f90
@@ -12,7 +12,7 @@ procedure(), pointer :: bar
integer, pointer :: bari
call c_f_procpointer(fptr,bar) ! { dg-error "Argument CPTR at .1. to C_F_PROCPOINTER shall have the type TYPE.C_FUNPTR." }
call c_f_pointer(fun,bari) ! { dg-error "Argument CPTR at .1. to C_F_POINTER shall have the type TYPE.C_PTR." }
-fun = fptr ! { dg-error "Can't convert TYPE.c_ptr. to TYPE.c_funptr." }
+fun = fptr ! { dg-error "Cannot convert TYPE.c_ptr. to TYPE.c_funptr." }
end
subroutine test()
diff --git a/gcc/testsuite/gfortran.dg/c_funloc_tests_6.f90 b/gcc/testsuite/gfortran.dg/c_funloc_tests_6.f90
index 669a119246f..45d095566d1 100644
--- a/gcc/testsuite/gfortran.dg/c_funloc_tests_6.f90
+++ b/gcc/testsuite/gfortran.dg/c_funloc_tests_6.f90
@@ -20,8 +20,8 @@ procedure(sub), pointer :: fsub
integer, external :: noCsub
procedure(integer), pointer :: fint
-cp = c_funloc (sub) ! { dg-error "Can't convert TYPE.c_funptr. to TYPE.c_ptr." })
-cfp = c_loc (int) ! { dg-error "Can't convert TYPE.c_ptr. to TYPE.c_funptr." }
+cp = c_funloc (sub) ! { dg-error "Cannot convert TYPE.c_funptr. to TYPE.c_ptr." })
+cfp = c_loc (int) ! { dg-error "Cannot convert TYPE.c_ptr. to TYPE.c_funptr." }
call c_f_pointer (cfp, int) ! { dg-error "Argument CPTR at .1. to C_F_POINTER shall have the type TYPE.C_PTR." }
call c_f_procpointer (cp, fsub) ! { dg-error "Argument CPTR at .1. to C_F_PROCPOINTER shall have the type TYPE.C_FUNPTR." }
diff --git a/gcc/testsuite/gfortran.dg/c_loc_tests_17.f90 b/gcc/testsuite/gfortran.dg/c_loc_tests_17.f90
index 5e4eb8affab..2ed8307ddcf 100644
--- a/gcc/testsuite/gfortran.dg/c_loc_tests_17.f90
+++ b/gcc/testsuite/gfortran.dg/c_loc_tests_17.f90
@@ -10,5 +10,5 @@ program aaaa
use iso_c_binding, only : c_loc
integer, target :: i
type(C_PTR) :: f_ptr ! { dg-error "being used before it is defined" }
- f_ptr=c_loc(i) ! { dg-error "Can't convert" }
+ f_ptr=c_loc(i) ! { dg-error "Cannot convert" }
end program aaaa
diff --git a/gcc/testsuite/gfortran.dg/constructor_9.f90 b/gcc/testsuite/gfortran.dg/constructor_9.f90
index a8e882138fd..a61b63a0fe5 100644
--- a/gcc/testsuite/gfortran.dg/constructor_9.f90
+++ b/gcc/testsuite/gfortran.dg/constructor_9.f90
@@ -15,6 +15,6 @@ module cf
contains
subroutine cfi()
type(cfmde), pointer :: cfd
- cfd=cfmde() ! { dg-error "Can't convert" }
+ cfd=cfmde() ! { dg-error "Cannot convert" }
end subroutine
end module
diff --git a/gcc/testsuite/gfortran.dg/dec_structure_8.f90 b/gcc/testsuite/gfortran.dg/dec_structure_8.f90
index f84bf156864..70faabfc0f5 100644
--- a/gcc/testsuite/gfortran.dg/dec_structure_8.f90
+++ b/gcc/testsuite/gfortran.dg/dec_structure_8.f90
@@ -11,7 +11,7 @@ structure /t1/ ! { dg-error "Type definition.*T1" }
integer b // ! { dg-error "Empty old style initializer list" }
integer c /2*3/ ! { dg-error "Repeat spec invalid in scalar" }
integer d /1,2,3/ ! { dg-error "End of scalar initializer expected" }
- integer e /"HI"/ ! { dg-error "Can't convert" }
+ integer e /"HI"/ ! { dg-error "Cannot convert" }
integer f(as) /4*9/ ! { dg-error "Too many elements" }
integer g(3) /1,3/ ! { dg-error "Not enough elements" }
integer h(3) /1,3,5,7/ ! { dg-error "Too many elements" }
diff --git a/gcc/testsuite/gfortran.dg/entry_4.f90 b/gcc/testsuite/gfortran.dg/entry_4.f90
index 9a3b89a620e..22d411b6022 100644
--- a/gcc/testsuite/gfortran.dg/entry_4.f90
+++ b/gcc/testsuite/gfortran.dg/entry_4.f90
@@ -1,5 +1,5 @@
! { dg-do compile { target i?86-*-* x86_64-*-* } }
-function f1 () result (r) ! { dg-error "can't be a POINTER" }
+function f1 () result (r) ! { dg-error "cannot be a POINTER" }
integer, pointer :: r
real e1
allocate (r)
@@ -11,14 +11,14 @@ entry e1a ()
e1a = 13
end function
function f2 ()
-integer, dimension (2, 7, 6) :: e2 ! { dg-error "can't be an array" }
+integer, dimension (2, 7, 6) :: e2 ! { dg-error "cannot be an array" }
f2 = 6
return
entry e2 ()
e2 (:, :, :) = 2
end function
-integer(kind=8) function f3 () ! { dg-error "can't be of type" }
-complex(kind=8) e3 ! { dg-error "can't be of type" }
+integer(kind=8) function f3 () ! { dg-error "cannot be of type" }
+complex(kind=8) e3 ! { dg-error "cannot be of type" }
f3 = 1
return
entry e3 ()
diff --git a/gcc/testsuite/gfortran.dg/init_char_with_nonchar_ctr.f90 b/gcc/testsuite/gfortran.dg/init_char_with_nonchar_ctr.f90
index b84a9a83c50..30111826645 100644
--- a/gcc/testsuite/gfortran.dg/init_char_with_nonchar_ctr.f90
+++ b/gcc/testsuite/gfortran.dg/init_char_with_nonchar_ctr.f90
@@ -7,7 +7,7 @@ subroutine s1
integer :: n = 0
end type
type t2
- character :: c = t() ! { dg-error "Can't convert TYPE\\(t\\) to CHARACTER\\(1\\)" }
+ character :: c = t() ! { dg-error "Cannot convert TYPE\\(t\\) to CHARACTER\\(1\\)" }
end type
end subroutine
@@ -15,20 +15,20 @@ subroutine s2
type t
end type
type t2
- character :: c(1) = [t()] ! { dg-error "Can't convert TYPE\\(t\\) to CHARACTER\\(1\\)" }
+ character :: c(1) = [t()] ! { dg-error "Cannot convert TYPE\\(t\\) to CHARACTER\\(1\\)" }
end type
end subroutine
subroutine s3
type t
integer :: a = 1
- character :: c = t() ! { dg-error "Can't convert TYPE\\(t\\) to CHARACTER\\(1\\)" }
+ character :: c = t() ! { dg-error "Cannot convert TYPE\\(t\\) to CHARACTER\\(1\\)" }
end type
end subroutine
subroutine s4
type t
integer, allocatable :: a
- character :: c = t() ! { dg-error "Can't convert TYPE\\(t\\) to CHARACTER\\(1\\)" }
+ character :: c = t() ! { dg-error "Cannot convert TYPE\\(t\\) to CHARACTER\\(1\\)" }
end type
end subroutine
diff --git a/gcc/testsuite/gfortran.dg/initialization_23.f90 b/gcc/testsuite/gfortran.dg/initialization_23.f90
index 1931bca96b4..a4683a3ddd2 100644
--- a/gcc/testsuite/gfortran.dg/initialization_23.f90
+++ b/gcc/testsuite/gfortran.dg/initialization_23.f90
@@ -9,6 +9,6 @@
TYPE :: one_parameter
CHARACTER :: name
END TYPE one_parameter
- CHARACTER, PARAMETER :: the_alpha = one_parameter('c') ! { dg-error "Can't convert TYPE" }
+ CHARACTER, PARAMETER :: the_alpha = one_parameter('c') ! { dg-error "Cannot convert TYPE" }
CHARACTER, PARAMETER :: the_beta = (/one_parameter('c')/) ! { dg-error "Incompatible ranks" }
END MODULE cdf_aux_mod
diff --git a/gcc/testsuite/gfortran.dg/logical_assignment_1.f90 b/gcc/testsuite/gfortran.dg/logical_assignment_1.f90
index c2289805118..e3c14f5b392 100644
--- a/gcc/testsuite/gfortran.dg/logical_assignment_1.f90
+++ b/gcc/testsuite/gfortran.dg/logical_assignment_1.f90
@@ -5,6 +5,6 @@
program emptyarray5
implicit none
real a(0)
- a = [logical::] ! { dg-error "Can't convert LOGICAL" }
+ a = [logical::] ! { dg-error "Cannot convert LOGICAL" }
print *,size(a)
end program emptyarray5
diff --git a/gcc/testsuite/gfortran.dg/pr80752.f90 b/gcc/testsuite/gfortran.dg/pr80752.f90
index 00a4b33d29a..710065ce4c9 100644
--- a/gcc/testsuite/gfortran.dg/pr80752.f90
+++ b/gcc/testsuite/gfortran.dg/pr80752.f90
@@ -7,7 +7,7 @@ module exchange_utils
integer, parameter, public :: knd = 8
type, private :: a
- logical :: add_vs98 = 0.0_knd ! { dg-error "Can't convert" }
+ logical :: add_vs98 = 0.0_knd ! { dg-error "Cannot convert" }
end type a
type, private :: x_param_t
diff --git a/gcc/testsuite/gfortran.dg/pr88116_1.f90 b/gcc/testsuite/gfortran.dg/pr88116_1.f90
index a64c818671e..67c6a260340 100644
--- a/gcc/testsuite/gfortran.dg/pr88116_1.f90
+++ b/gcc/testsuite/gfortran.dg/pr88116_1.f90
@@ -1,4 +1,4 @@
! { dg-do compile }
program p
- print *, [integer :: 1, [integer(8) :: 2, ['3']]] ! { dg-error "Can't convert" }
+ print *, [integer :: 1, [integer(8) :: 2, ['3']]] ! { dg-error "Cannot convert" }
end
diff --git a/gcc/testsuite/gfortran.dg/pr88467.f90 b/gcc/testsuite/gfortran.dg/pr88467.f90
index 6a9666284a3..5424c06b884 100644
--- a/gcc/testsuite/gfortran.dg/pr88467.f90
+++ b/gcc/testsuite/gfortran.dg/pr88467.f90
@@ -1,4 +1,4 @@
! { dg-do compile }
program foo
- print *, [integer :: 1, [integer(8) :: 2, '3']] ! { dg-error "Can't convert" }
+ print *, [integer :: 1, [integer(8) :: 2, '3']] ! { dg-error "Cannot convert" }
end program foo
diff --git a/gcc/testsuite/gfortran.dg/typebound_call_7.f03 b/gcc/testsuite/gfortran.dg/typebound_call_7.f03
index 7e7209c198a..81d8162528b 100644
--- a/gcc/testsuite/gfortran.dg/typebound_call_7.f03
+++ b/gcc/testsuite/gfortran.dg/typebound_call_7.f03
@@ -38,7 +38,7 @@ CONTAINS
REAL :: resArr(3), resSmall(2)
res = sys%solve1 () ! { dg-error "Incompatible rank" }
- res = sys%solve2 () ! { dg-error "Can't convert" }
+ res = sys%solve2 () ! { dg-error "Cannot convert" }
resSmall = sys%solve1 () ! { dg-error "Different shape" }
res = sys%solve3 ()
diff --git a/gcc/testsuite/gfortran.dg/typebound_generic_1.f03 b/gcc/testsuite/gfortran.dg/typebound_generic_1.f03
index f9c471ae96a..dd54e66881b 100644
--- a/gcc/testsuite/gfortran.dg/typebound_generic_1.f03
+++ b/gcc/testsuite/gfortran.dg/typebound_generic_1.f03
@@ -55,10 +55,10 @@ MODULE m
CONTAINS
GENERIC :: gen2 => p1a ! { dg-error "are ambiguous" }
GENERIC :: gen2 => p3
- GENERIC :: p1 => p2 ! { dg-error "can't overwrite specific" }
+ GENERIC :: p1 => p2 ! { dg-error "cannot overwrite specific" }
GENERIC :: gensub => p2 ! { dg-error "mixed FUNCTION/SUBROUTINE" }
- PROCEDURE, NOPASS :: gen1 => intf1 ! { dg-error "Can't overwrite GENERIC" }
+ PROCEDURE, NOPASS :: gen1 => intf1 ! { dg-error "Cannot overwrite GENERIC" }
END TYPE t
CONTAINS
diff --git a/gcc/testsuite/gfortran.dg/typebound_operator_2.f03 b/gcc/testsuite/gfortran.dg/typebound_operator_2.f03
index 67b6b5e0326..bdef47d4087 100644
--- a/gcc/testsuite/gfortran.dg/typebound_operator_2.f03
+++ b/gcc/testsuite/gfortran.dg/typebound_operator_2.f03
@@ -31,8 +31,8 @@ MODULE m
GENERIC :: OPERATOR(.UNARY.) => onearg_alt
GENERIC, PRIVATE :: OPERATOR(.UNARY.) => onearg_alt2 ! { dg-error "must have the same access" }
- GENERIC :: OPERATOR(.UNARYPRIME.) => nopassed ! { dg-error "can't be NOPASS" }
- GENERIC :: OPERATOR(-) => nopassed ! { dg-error "can't be NOPASS" }
+ GENERIC :: OPERATOR(.UNARYPRIME.) => nopassed ! { dg-error "cannot be NOPASS" }
+ GENERIC :: OPERATOR(-) => nopassed ! { dg-error "cannot be NOPASS" }
END TYPE t
CONTAINS
diff --git a/gcc/testsuite/gfortran.dg/typebound_operator_4.f03 b/gcc/testsuite/gfortran.dg/typebound_operator_4.f03
index cd0e8f602ae..3dc3cae3156 100644
--- a/gcc/testsuite/gfortran.dg/typebound_operator_4.f03
+++ b/gcc/testsuite/gfortran.dg/typebound_operator_4.f03
@@ -54,7 +54,7 @@ CONTAINS
SUBROUTINE in_module ()
TYPE(myint) :: x
- x = 0 ! { dg-bogus "Can't convert" }
+ x = 0 ! { dg-bogus "Cannot convert" }
x = x + 42 ! { dg-bogus "Operands of" }
x = x .PLUS. 5 ! { dg-bogus "Unknown operator" }
END SUBROUTINE in_module
@@ -83,7 +83,7 @@ PROGRAM main
IMPLICIT NONE
TYPE(myint) :: x
- x = 0 ! { dg-error "Can't convert" }
+ x = 0 ! { dg-error "Cannot convert" }
x = x + 42 ! { dg-error "binary intrinsic numeric operator" }
x = x .PLUS. 5 ! { dg-error "Unknown operator" }
END PROGRAM main
diff --git a/gcc/testsuite/gfortran.dg/typebound_proc_9.f03 b/gcc/testsuite/gfortran.dg/typebound_proc_9.f03
index a6ca35bb010..e3dc7863f01 100644
--- a/gcc/testsuite/gfortran.dg/typebound_proc_9.f03
+++ b/gcc/testsuite/gfortran.dg/typebound_proc_9.f03
@@ -20,7 +20,7 @@ MODULE testmod
CONTAINS
PROCEDURE, DEFERRED :: p2 ! { dg-error "Interface must be specified" }
PROCEDURE(intf), NOPASS :: p3 ! { dg-error "should be declared DEFERRED" }
- PROCEDURE(intf), DEFERRED, NON_OVERRIDABLE :: p4 ! { dg-error "can't both" }
+ PROCEDURE(intf), DEFERRED, NON_OVERRIDABLE :: p4 ! { dg-error "cannot both" }
PROCEDURE(unknown), DEFERRED :: p5 ! { dg-error "has no IMPLICIT|must be explicit" }
PROCEDURE(intf), DEFERRED, DEFERRED :: p6 ! { dg-error "Duplicate DEFERRED" }
PROCEDURE(intf), DEFERRED :: p6 => proc ! { dg-error "is invalid for DEFERRED" }
diff --git a/gcc/testsuite/gfortran.dg/unlimited_polymorphic_2.f03 b/gcc/testsuite/gfortran.dg/unlimited_polymorphic_2.f03
index 13d7f8e466a..ee4523dd696 100644
--- a/gcc/testsuite/gfortran.dg/unlimited_polymorphic_2.f03
+++ b/gcc/testsuite/gfortran.dg/unlimited_polymorphic_2.f03
@@ -20,7 +20,7 @@
! F2008: C4106
u2 = [u1] ! { dg-error "shall not be unlimited polymorphic" }
- i = u2 ! { dg-error "Can\\'t convert CLASS\\(\\*\\)" }
+ i = u2 ! { dg-error "Cannot convert CLASS\\(\\*\\)" }
! Repeats same_type_as_1.f03 for unlimited polymorphic u2
flag = same_type_as (i, u2) ! { dg-error "cannot be of type INTEGER" }
--
2.21.0
^ permalink raw reply [flat|nested] 8+ messages in thread