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

--- Comment #10 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Sun, Sep 12, 2021 at 11:40:31PM +0000, rimvydas.jas at gmail dot com wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102145
> > -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.
> The -std=legacy already implies -fallow-argument-mismatch and wrongfully warns
> by default.  Consider gfortran -std=legacy -Wpedantic -Wno-error=pedantic -c.
> 

Yes, I know -std=legacy implies -fallow-argument-mismatch.  The 
option degrades an ERROR to a WARNING.  That is all it does.
With -std=legacy, gfortran is acknowledging that a user is
throwing potential garbage at it.  If -pedantic or -pedantic-error 
turns the warning back into an error, so what?  The user can
remove the idiotic option.  Telling gfortran you want -std=legacy
and -pedantic is an oxymoron.  Either you want gfortran to compile 
your garbage or you want gfortran to faithfully follow the
Fortran standard.

The Fortran standard for more that 55 years has said argument 
mismatch is invalid Fortran.  In the old days, Fortran processors
lacked the ability to diagnose the problem.  gfortran can, under
some circumstance, diagnose the issue and should tell the user
via an error message that the Fortran code is invalid. 

I'll also point out that you stated some projects have started to
remove -pedantic because -fallow-argument-mismatch is throwing
an error.  Why are these projects using -pedantic if the projects
are not actively fixing the reported warnings.  It seems the 
issue with -fallow-argument-mismatch is doing what it ought to
do.  That is, encourage user to FIX THEIR INVALID FORTRAN CODE.


> > 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.
> Until every compiler vendor agree on universal module format for things like
> "USE MPI" or "USE MPI_F08", the HPC applications will continue to use F77
> "mpif.h" include, unless "buffer" type would get standardized.

I don't care what other Fortran vendors do.  Other Fortran vendors
have a monetary reason to bend to the purses of users.  gfortran
does not have that burden (at least, I've never seen a dime for 
2 decades of contributions to gfortran).  gfortran is likely the
most used Fortran compiler on this planet; it does not need to 
lower its standards.  If your friend jumps off a bridge, should
you follow?

Reply via email to