``` Thanks for input. I will work toward the warning in legacy, otherwise error.
Jerry ``` On Sat, Jul 4, 2026, 3:44 AM Thomas Koenig <[email protected]> wrote: > Am 03.07.26 um 18:56 schrieb Steve Kargl: > > > IMHO, gfortran should issue a hard error for a non-integer index. > > I looked at what other compilers are doing, at godbolt, with > standard options. > > gfortran accepts with a warning. > > flang: rejects > > ifort/ifx: accepts silently > > nvfortran: accepts with warning > > so this is mixed. > > I would prefer issuing an error without -std=legacy, and > always issuing a warning with that option. Why? > > There are safety-relevant application fields where code changes > need to go through a lengthy and expensive recertification process. > > People using such code would then be pushed towards using a compiler > family that accepts this kind of thing, that is ifort/ifx, and that > is not platform-independent (and not gfortran). > > But users who are under no such restrictions should be pointed > towards doing the right thing as strongly as possible, without > breaking things for the case above. > > For this, so my preference would be the same as yours for > real DO control variables > > So, gfortran should accept REAL DO control variables and > > control expressions with -std=legacy. Issuing a warning > > would seem to be appropriate even with the -std=legacy > > option. > > Side remark: I understand why REAL index variables were removed, > because of code like > > do a=0,1,0.1 > > where the number of iterations is indeterminate. However, if written > like > > do a=0,1.05,0.1 > > there is no ambiguity. But that particular ship has sailed. > > Best regards > > Thomas > > > >
