[Bug fortran/102145] TKR mismatches with -pedantic: -fallow-argument-mismatch does not degrade errors to warnings

sgk at troutmask dot apl.washington.edu gcc-bugzilla@gcc.gnu.org
Sun Sep 12 22:56:28 GMT 2021


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

--- Comment #8 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Sun, Sep 12, 2021 at 07:34:17PM +0000, rimvydas.jas at gmail dot com wrote:
> 
> > No, it is not.  The -fallow-argument-match option was given to
> > user to allow them to compile their broken code.  It was decided
> > to degrade a error into a warning with this option.  If you then
> > use an option that wants to PEDANTIC with respect to the requirements
> > of the Fortran 66, 77, 90, 95, 2003, 2008, and 2018 standard, then
> > you're going to get an error.
> Nobody said -fallow-argument-mismatch should work under say -std=f2008 (and it
> is OK if it doesn't).  Users complain about -std=legacy or -std=gnu behavior
> and -pedantic acting like -pedantic-errors when it shouldn't.  All this done
> was force users to make haste changes to keep code compiling while disturbing
> sometimes carefully crafted codes or simply splitting units into separate
> fortran souces so that compiler "does not see" this information.
> 

Yes, it should behave like -pedantic-errors.  Why not ask the
people involved in deciding on -fallow-argument-mismatch behavior.
An argument mismatch was never permitted under any Fortran standard.
It was decided that gfortran would now issue an error if it detected
a mismatch.  -fallow-argument-mismatch was added to allow users,
who refuse to fix their code, the ability to downgrade the error
to a warning.  If -pedantic changes -fallow-argument-mismatch
back to an error, then don't use -pedantic.

And, no, the code was not "carefully crafted".  Code, which exploits
argument mismatch, has always been invalid Fortran.  It is time that
those codes are fixed.


More information about the Gcc-bugs mailing list