From 86ba9ce62614375784f5ce92d711e00db391d81e Mon Sep 17 00:00:00 2001 From: Thomas Koenig Date: Thu, 1 Nov 2018 12:00:59 +0000 Subject: [PATCH] re PR fortran/46020 (Improve error string for BIND(C) diagnostic for len>1 character return type) 2018-11-01 Thomas Koenig PR fortran/46020 * decl.c (verify_bind_c_sym): Improve error message. From-SVN: r265719 --- gcc/fortran/ChangeLog | 5 +++++ gcc/fortran/decl.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 4e0869b5abe..87f3312eeef 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2018-11-01 Thomas Koenig + + PR fortran/46020 + * decl.c (verify_bind_c_sym): Improve error message. + 2018-11-01 Thomas Koenig PR fortran/54613 diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 87c736fb2db..47c939ca85e 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -5647,8 +5647,8 @@ verify_bind_c_sym (gfc_symbol *tmp_sym, gfc_typespec *ts, if (tmp_sym->ts.u.cl == NULL || tmp_sym->ts.u.cl->length == NULL || tmp_sym->ts.u.cl->length->expr_type != EXPR_CONSTANT || mpz_cmp_si (tmp_sym->ts.u.cl->length->value.integer, 1) != 0) - gfc_error ("Return type of BIND(C) function %qs at %L cannot " - "be a character string", tmp_sym->name, + gfc_error ("Return type of BIND(C) function %qs of character " + "type at %L must have length 1 ", tmp_sym->name, &(tmp_sym->declared_at)); } -- 2.30.2