PR69741: Bad error in formal with array scalar loop counters

Steve Kargl sgk@troutmask.apl.washington.edu
Sat Nov 19 01:18:00 GMT 2016


On Sat, Nov 19, 2016 at 12:34:12AM +0100, Harald Anlauf wrote:
> 
> I'd suggest a slightly updated version of my patch in comment #7,
> which generates less noise:
> 
> Index: gcc/fortran/resolve.c
> ===================================================================
> --- gcc/fortran/resolve.c       (revision 242607)
> +++ gcc/fortran/resolve.c       (working copy)
> @@ -9668,6 +9668,13 @@
>       and stride. The FORALL index can not appear in start, end or
> stride.  */
>    for (fa = code->ext.forall_iterator; fa; fa = fa->next)
>      {
> +      if (fa->var->ref && fa->var->ref->type == REF_ARRAY)
> +       {
> +         gfc_error ("FORALL index-name at %L must be a scalar INTEGER",
> +                    &fa->var->where);


The error message is still not clear.  42 is a scalar integer.  Why
not use the language in the standard?

C739 (R753) The index-name shall be a named scalar variable of type integer.

> 
> Whoever wants to take this one.
> 

Ever thought about getting a commit bit and getting more involved
in gfortran development?  I know 4 or 5 other gentlemen that would
welcome you with open arms.

-- 
Steve



More information about the Fortran mailing list