http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58498
--- Comment #2 from janus at gcc dot gnu.org ---
With this patch ...

Index: gcc/fortran/check.c
===================================================================
--- gcc/fortran/check.c (revision 202812)
+++ gcc/fortran/check.c (working copy)
@@ -173,8 +173,8 @@ kind_check (gfc_expr *k, int n, bt type)
   if (gfc_extract_int (k, &kind) != NULL
       || gfc_validate_kind (type, kind, true) < 0)
     {
-      gfc_error ("Invalid kind for %s at %L", gfc_basic_typename (type),
-                &k->where);
+      gfc_error ("Invalid kind '%i' for %s at %L", kind,
+                gfc_basic_typename (type), &k->where);
       return false;
     }


... the output is:

   iRANGES = (/(range(int(0,iKINDS(i))),i=1,size(iKINDS))/)
                            1
Error: Invalid kind '0' for INTEGER at (1)


This is strange, since none of the iKINDS is zero (as comment 1 shows). In any
case, this extension of the error message might be helpful in situations like
this, where the kind is not directly supplied by a number, but by some
initialization expression ...

Reply via email to