[PATCH] D97119: [flang][driver] Add options for -std=f2018

Richard Barton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 2 08:21:37 PST 2021


richard.barton.arm added a comment.

I agree with @tskeith that `-Mstandard` is not exactly orthogonal to `-std`, the former being about warning for non-standard extensions/deviations and the latter being about use of standard fortran, but from a different standard version. I would expect `-Mstandard` to apply to whatever value of `-std` you gave the compiler.

I think the gfortran analog to `-Mstandard` is `-fpedantic` or `-fpedantic-errors` - see https://gcc.gnu.org/onlinedocs/gfortran/Error-and-Warning-Options.html#Error-and-Warning-Options. The docs have a little joke in them about the feature not doing what users want, but I think that's just a witty way to say that the feature is incomplete, but that it is expected to catch things in theory. So maybe `-fpedantic{-errors}` is a good thing to substitute for `-Mstandard`?

FWIW, I think supporting `-std` with only one supported option is a reasonable thing to do and will help with folks porting codes to flang from gfortran to accept the option and to know what's supported and what is not. Perhaps the perfect thing would be supporting all the sensible gfortran values for `-std`, but emitting a (downgradable) warning or remark when one that is not supported is given. That would let users know what they are dealing with until the day when flang supports other values for `-std`. I doubt supporting older versions is on anyone's short-term roadmap, but patches would probably be welcomed on that. I guess there will one day be a `-std=f202X` option supported too!


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97119/new/

https://reviews.llvm.org/D97119



More information about the cfe-commits mailing list