https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84382

--- Comment #4 from janus at gcc dot gnu.org ---
(In reply to kargl from comment #3)
> How do you propose to enforce a certain standard and allow
> GNU extensions?  For example, -std=gnu2003 would enforce
> Fortran 2003, but allow GNU extensions.  The problem is that
> gfortran allows several extensions that violate the
> standard.

The idea is that -std=gnu2003 would allow 2003 features plus GNU extensions,
but reject any 2008 and 2018 features (like submodules and coarrays).


> gfortran even allows extensions that aren't caught by the -std
> options and are not document!

That's a separate issue and discussion, not related to this PR. Ideally all
extensions should be caught and documented, of course.



> I think it will becomes a endless discussion on what should
> and should not be covered under -std=gnu2003.

I don't see that. We already have a more-or-less complete classification of
what is a 2003 or 2008 feature and what is a non-std extension.

My proposal would simply introduce new options corresponding to different
combinations of feature classes.

> What we have
> now seems to be the most reasonable approach (with the 
> available man power to address problem).  Either a user
> wants GNU Fortran (ie., -std=gnu, the default behavior) or
> a user wants a stricter adherence to a particular standard.

I have not really thought about how to implement this PR. I assumed it would be
easy to modify/extend gfc_notify_std & friends to accomomdate some new feature
levels.

At some point I just had the idea for this PR and I wanted to write it down for
the future to think about and evaluate the idea. I haven't started an
implementation because it's not high priority for me.

If it's simply not needed or there is consensus that it's not worth the effort,
then I'm willing to discuss and possibly close this PR, but certainly not due
to someone yelling WTF.

Also I don't see what's wrong about letting it hang in bugzilla until it
becomes a priority/necessity for someone.

Reply via email to