Am 08.09.24 um 07:25 schrieb Steve Kargl:
On Sat, Sep 07, 2024 at 08:17:42PM -0700, Jerry D wrote:
Steve and others

We continue to run into issues with PRs like this.  I would like to close
these out.  I completely hate the mechanisms we have for the options.  Why?
Because every time I look at it I have to think it through ten ways to
sunday. It is not straight forward.

What I would like to do is give a hard error fro out of compliance stuff and
with std=legacy give a warning.

This is almost a policy question really. What is your opinion. Move forward
with what I just suggested here?


See my comment #6 in 88052.

Hindsight is 20-20.

I personally would like to see -std=f2023 made the default.

Any, and all, extensions would require an explicit option to
accept the non-standard Fortran construct.

Unfortuantely, the -std=gnu ship sailed years ago.


I think we agree that the current situation is not satisfactory,
but I would be careful here, as we do not want to break real
legacy codes unless there is a good reason to do so.

My understanding is that -std=legacy means "accept - usually even
without a warning - what was given if it is implemented in gfortran".

The other side is -std=f20xy, where we do check and usually generate
errors or at least warnings for non-conforming code.

The default ("-std=gnu") is IMHO *not* a real standard; it merely
describes the set of Fortranish-looking stuff (including standard
stuff) that is handled by gfortran if no -std= is given and then
gives *no* warning.

A way forward I could imagine is triaging the differences between
what is accepted by default (i.e. -std=gnu) and the real standard,
and if we think that extension should for some reason be downgraded
to -std=legacy, then we do that.  (E.g. if it violates a constraint,
then it is a primary candidate.)  That would allow a smooth, although
slow, transition to better compile-time diagnostics.

That said, having no real (since undefined) gnu standard, would offer
the option that the runtime should see either -std=legacy being passed,
or a real -std=f20xy would enforce standard-conforming behavior.
I currently see no sense in having a special -std=gnu in the runtime:
either standard (with warning/error), or legacy (silent unless hard
error).  Or does anyone see a point differentiating gnu/legacy here?

I do not think that we plan to add extensions in the future that are
not backed by a standard.  And if users report PRs against legacy
stuff, it is unlikely to attract attention by the developers, and
may not get fixed if it might get in the way of doing more useful
things.

(Some extensions are hidden behind special flags, e.g. the DEC
extensions.  That would be another option to demote subsets of
extensions from the default, but only at compile-time.)

But to get back to Jerry's original mail: I would likely not
generate a warning with -std=legacy if it can be avoided.

Cheers,
Harald

Reply via email to