public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "sgk at troutmask dot apl.washington.edu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/102145] TKR mismatches with -pedantic: -fallow-argument-mismatch does not degrade errors to warnings
Date: Mon, 13 Sep 2021 02:52:32 +0000	[thread overview]
Message-ID: <bug-102145-4-TrWpO6Vc2H@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-102145-4@http.gcc.gnu.org/bugzilla/>

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?

  parent reply	other threads:[~2021-09-13  2:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-31 14:59 [Bug fortran/102145] New: " ripero84 at gmail dot com
2021-08-31 17:24 ` [Bug fortran/102145] " kargl at gcc dot gnu.org
2021-09-08 14:14 ` ripero84 at gmail dot com
2021-09-08 16:51 ` sgk at troutmask dot apl.washington.edu
2021-09-12 19:08 ` rimvydas.jas at gmail dot com
2021-09-12 19:09 ` rimvydas.jas at gmail dot com
2021-09-12 19:22 ` kargl at gcc dot gnu.org
2021-09-12 19:34 ` rimvydas.jas at gmail dot com
2021-09-12 22:56 ` sgk at troutmask dot apl.washington.edu
2021-09-12 23:40 ` rimvydas.jas at gmail dot com
2021-09-13  2:52 ` sgk at troutmask dot apl.washington.edu [this message]
2021-09-13  5:18 ` rimvydas.jas at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-102145-4-TrWpO6Vc2H@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).