This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, fortran] Fix translation issue with character length * errors (PR fortran/79860)


This diagnostic from fortran/resolve.c:

gfc_error ("Character-valued %s %qs at %L must not be"
           " assumed length",
           module_proc ? _("module procedure") : _("internal function"),
           sym->name, &sym->declared_at);

is problematic for translation, in particular, to German, where the
two alternatives have different gramatical form.

This patch reworks the message to avoid the issue.

Successfully bootstrapped&regrtested on x86_64-pc-linux-gnu.

OK for trunk? (either now in stage 4, or for next stage1?)

gcc/fortran/ChangeLog:
	PR fortran/79860
	* resolve.c (resolve_contained_fntype): Make error messages more
	amenable to translation.
---
 gcc/fortran/resolve.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 1fbc9f6..accb5a2 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -615,10 +615,11 @@ resolve_contained_fntype (gfc_symbol *sym, gfc_namespace *ns)
 	  gcc_assert (ns->parent && ns->parent->proc_name);
 	  module_proc = (ns->parent->proc_name->attr.flavor == FL_MODULE);
 
-	  gfc_error ("Character-valued %s %qs at %L must not be"
-		     " assumed length",
-		     module_proc ? _("module procedure")
-				 : _("internal function"),
+	  gfc_error (module_proc
+		     ? G_("Character-valued module procedure %qs at %L"
+			  " must not be assumed length")
+		     : G_("Character-valued internal function %qs at %L"
+			  " must not be assumed length"),
 		     sym->name, &sym->declared_at);
 	}
     }
-- 
1.8.5.3


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]