------- Comment #2 from pault at gcc dot gnu dot org 2007-04-19 20:47 ------- (In reply to comment #1)
This does the trick but I haven't checked against the standard, nor have I regtested. Paul Index: /svn/trunk/gcc/fortran/check.c =================================================================== *** /svn/trunk/gcc/fortran/check.c (revision 123643) --- /svn/trunk/gcc/fortran/check.c (working copy) *************** static try *** 218,224 **** same_type_check (gfc_expr *e, int n, gfc_expr *f, int m) { if (gfc_compare_types (&e->ts, &f->ts)) ! return SUCCESS; gfc_error ("'%s' argument of '%s' intrinsic at %L must be the same type " "and kind as '%s'", gfc_current_intrinsic_arg[m], --- 218,241 ---- same_type_check (gfc_expr *e, int n, gfc_expr *f, int m) { if (gfc_compare_types (&e->ts, &f->ts)) ! { ! if (e->ts.type != BT_CHARACTER) ! return SUCCESS; ! ! else if (e->ts.cl->length ! && e->ts.cl->length->expr_type == EXPR_CONSTANT ! && f->ts.cl->length ! && f->ts.cl->length->expr_type == EXPR_CONSTANT ! && mpz_cmp (e->ts.cl->length->value.integer, ! f->ts.cl->length->value.integer) != 0) ! { ! gfc_error ("'%s' argument of '%s' intrinsic at %L must have " ! "the same character length as '%s'", ! gfc_current_intrinsic_arg[m], gfc_current_intrinsic, ! &f->where, gfc_current_intrinsic_arg[n]); ! return FAILURE; ! } ! } gfc_error ("'%s' argument of '%s' intrinsic at %L must be the same type " "and kind as '%s'", gfc_current_intrinsic_arg[m], -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31610