Discussion:
[fortran, patch, committed] Adjust error message
Thomas Koenig
2018-11-01 12:05:39 UTC
Permalink
Hello world,

I just adjusted the error message for BIND(C) functions which
return strings of length > 1. I just used the suggestion from
the PR. Committed as obvious and simple (although I managed
to use up three revisions to do it right :-)

Regards

Thomas

2018-11-01 Thomas Koenig <***@gcc.gnu.org>

PR fortran/46020
* decl.c (verify_bind_c_sym): Improve error message.

2018-11-01 Thomas Koenig <***@gcc.gnu.org>

PR fortran/46020
* gfortran.dg/bind_c_usage_7.f90: Adjust error message.
* gfortran.dg/bind_c_usage_32.f90: New test.
Bernhard Reutner-Fischer
2018-11-02 12:28:45 UTC
Permalink
On Thu, 1 Nov 2018 13:05:39 +0100
Post by Thomas Koenig
Hello world,
I just adjusted the error message for BIND(C) functions which
return strings of length > 1. I just used the suggestion from
the PR. Committed as obvious and simple (although I managed
to use up three revisions to do it right :-)
heh, so you don't mind if we make this four, right :)

+ 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));

Please remove the trailing whitespace (after "length 1").

TIA,
Thomas Koenig
2018-11-02 20:22:11 UTC
Permalink
Post by Bernhard Reutner-Fischer
Please remove the trailing whitespace (after "length 1").
Done (r265732).

2018-11-02 Thomas Koenig <***@gcc.gnu.org>

PR fortran/46020
* decl.c (verify_bind_c_sym): Remove unnecessary space
in error message.

Index: decl.c
===================================================================
--- decl.c (Revision 265732)
+++ decl.c (Arbeitskopie)
@@ -5648,7 +5648,7 @@ verify_bind_c_sym (gfc_symbol *tmp_sym, gfc_typesp
|| 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 of character "
- "type at %L must have length 1 ", tmp_sym->name,
+ "type at %L must have length 1", tmp_sym->name,
&(tmp_sym->declared_at));
}

Regards

Thomas

Loading...