From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 59D463857805; Mon, 13 Sep 2021 02:52:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 59D463857805 From: "sgk at troutmask dot apl.washington.edu" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 11.2.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: enhancement X-Bugzilla-Who: sgk at troutmask dot apl.washington.edu X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P5 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 02:52:32 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102145 --- Comment #10 from Steve Kargl = --- On Sun, Sep 12, 2021 at 11:40:31PM +0000, rimvydas.jas at gmail dot com wro= te: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102145 > > -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=3Dlegacy already implies -fallow-argument-mismatch and wrongfull= y warns > by default. Consider gfortran -std=3Dlegacy -Wpedantic -Wno-error=3Dpeda= ntic -c. >=20 Yes, I know -std=3Dlegacy implies -fallow-argument-mismatch. The=20 option degrades an ERROR to a WARNING. That is all it does. With -std=3Dlegacy, gfortran is acknowledging that a user is throwing potential garbage at it. If -pedantic or -pedantic-error=20 turns the warning back into an error, so what? The user can remove the idiotic option. Telling gfortran you want -std=3Dlegacy and -pedantic is an oxymoron. Either you want gfortran to compile=20 your garbage or you want gfortran to faithfully follow the Fortran standard. The Fortran standard for more that 55 years has said argument=20 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.=20 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=20 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 l= ike > "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=20 2 decades of contributions to gfortran). gfortran is likely the most used Fortran compiler on this planet; it does not need to=20 lower its standards. If your friend jumps off a bridge, should you follow?=