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

--- Comment #2 from ripero84 at gmail dot com ---
1) The gfortran manual has its own entries for -pedantic and -pedantic-errors:

-Wpedantic
-pedantic
     Issue warnings for uses of extensions to Fortran.  -pedantic also
     applies to C-language constructs where they occur in GNU Fortran
     source files, such as use of \e in a character constant within a
     directive like "#include".

     Valid Fortran programs should compile properly with or without
     this option.  However, without this option, certain GNU extensions
     and traditional Fortran features are supported as well.  With this
     option, many of them are rejected.

     Some users try to use -pedantic to check programs for conformance.
     They soon find that it does not do quite what they want---it finds
     some nonstandard practices, but not all.  However, improvements to
     GNU Fortran in this area are welcome.

     This should be used in conjunction with -std=f95, -std=f2003,
     -std=f2008 or -std=f2018.

-pedantic-errors
     Like -pedantic, except that errors are produced rather than
     warnings.

The first lines of each description are quite clear about -pedantic issuing
warnings and -pedantic-errors issuing errors instead of warnings, in what
sounds like a very reasonable strategy.  But then the second paragraph of
-pedantic says that many (unspecified) non-standard features will be rejected.

2) This answers part of my issue: the behaviour is indeed documented, just in a
way that has proved confusing to me.  It think that a more accurate description
would start with: 

-pedantic: Issue warnings for some uses of extensions to Fortran, raise
otherwise warnings to errors for others.  Not all extensions will raise
warnings or errors.

which sounds bad.

3) If this is the intended behaviour I can propose some tweaks to the
documentation, but as I said first I would like to have a confirmation (ideally
by the person who set up the interaction between -pedantic and
-fallow-argument-mismatch) that this is really intended behaviour, not
accidental.

4) Apologies for not going into the C discussion, my C is limited, and to start
with I don't understand the "warnings demanded by strict ISO C" statement:
ISO/IEC 9899:2017, Annex I (informative) "Common warnings" says that "An
implementation may generate warnings in many situations, none of which are
specified as part of this International Standard", so I don't really know what
the "demanded warnings" are.

Thank you for your help.

Reply via email to