public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "kargl at gcc dot gnu.org" <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: Sun, 12 Sep 2021 19:22:55 +0000	[thread overview]
Message-ID: <bug-102145-4-SNhJ4muYiB@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 #6 from kargl at gcc dot gnu.org ---
(In reply to Rimvydas (RJ) from comment #4)
> (In reply to ripero84 from comment #0)
> > In the presence of -pedantic, -fallow-argument-mismatch fails to degrade the
> > mismatch errors to warnings:
> > 
> > This is:
> > - undocumented; and
> > - unexpected, since it effectively means that by adding -pedantic to a
> > compilation line that already contains -fallow-argument-mismatch, mismatch
> > warnings are upgraded to errors, despite -pedantic is only supposed to issue
> > warnings.
> 
> This made many projects just simply remove -pedantic[-errors] and
> -Werror[=foo] from building recipes for newer gfortran versions until
> behavior changes.

Good for those projects.  The correct response would have been
to fix the source, which has never conformed to any Fortran
standard (starting with Fortran 66).


> Any software that includes hdf.inc, netcdf.inc and
> especially mpif.h is simply not suitable for checking if actually deprecated
> and/or deleted features are being used in the user when code compilation
> aborts on first file with argument mismatch even for -std=legacy -pedantic.

Well, that's what it should do!  Argument mismatch has never
been permitted by any Fortran standard.  So, PEDANTICALLY
speaking it is an error to allow.  The correct solution is
to fix the source code.

> Without going into unrelated and even mildly disheartening long paragraphs
> without useful information, most of this started with removal of
> -Wargument-mismatch option.

No, it started when gfortran grew the ability to diagnosis the
the problem.  It is an error.  gfortran is telling the user
it is an error.  

> While it is understandable why it was done like this from compiler developer
> perspective, it is a major breakage for what user expects or expected
> previously from the compiler.

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.

  parent reply	other threads:[~2021-09-12 19:22 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 [this message]
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

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