public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rimvydas.jas at gmail dot com" <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 05:18:17 +0000	[thread overview]
Message-ID: <bug-102145-4-UQQIF3JAPN@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 #11 from Rimvydas (RJ) <rimvydas.jas at gmail dot com> ---
(In reply to Steve Kargl from comment #10)
> 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.  [snip]
> 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.
Nobody would complain if compiler acted consistently and error would happen
only with -pedantic-errors.  See gcc/testsuite/gfortran.dg/hollerith8.f90 how
it is affected by -std=legacy vs -std=legacy -pedantic vs -std=f2008,
specifically the part:
 call wrtout (9hHELLO YOU, 9)
Warning: Legacy Extension: Hollerith constant at (1)
Users would be satisfied with:
Warning: Legacy extension: Invalid argument mismatch at (1).
It not so hard to acknowledge that consistency was broken and it is still
easily fixable.  There is nothing oxy about -pedantic not giving hard error
when there is -pedantic-errors for this.

> 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.
Still there is no good reason to break older codebases that were accepted 3
years ago with -std=legacy or -std=gnu -fallow-argument-mismatch if -std=f2008
strictly rejects them.

> 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.
Previously -pedantic was used in makefile recipes to check (usually in a
separate compilation) for new warnings differences between compiler releases
about new legacy or deleted features, because it is easier way than diff
standard texts or code changes in compiler frontend.  Sadly these recipes are
being removed now.  As for fixing part, consider:
program test
 stop 1
contains
 subroutine todo1
 call mpi_send(1)
 end subroutine
 subroutine todo2
 call mpi_send(1.)
 end subroutine
end program

Hard diagnostic is now issued even for unreachable code parts and this forces
users to simply move out code parts giving hard errors to separate fortran
sources by use of wrappers without interfaces (often with real bugs when code
changes getting merged from different development branches).  Not only this
forces anyone debugging such changes to rely on LTO alone, but encourages
avoiding use of -Werror or -Werror=foo to prevent issues in future compiler
releases because compiler has growing inconsistency reputation.

> I don't care what other Fortran vendors do.  Other Fortran vendors
> have a monetary reason to bend to the purses of users.
MPI issue is not what other Fortran vendors are doing.  The given MPI
implementation (possibly MPI vendor optimized or debugging one) needs to
provide mpi.mod or mpi_f08.mod modules for every gfortran major version just to
import information about MPI interfaces.  This is why f77 mpif.h (usually
without explicit interfaces or use of "!gcc$ attributes no_arg_check :: arg")
include way is still preferred.  As for last bit, it is quite surprising and
really unnecessary in modern times.  If you need to know, then all depends on
the given friend and how consistent he/she is. :)

      parent reply	other threads:[~2021-09-13  5:18 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
2021-09-13  5:18 ` rimvydas.jas at gmail dot com [this message]

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-UQQIF3JAPN@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).