From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 898A03858413; Sun, 12 Sep 2021 19:08:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 898A03858413 From: "rimvydas.jas at gmail dot com" 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:08:18 +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: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: rimvydas.jas at gmail dot com 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: cc 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: Sun, 12 Sep 2021 19:08:18 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102145 Rimvydas (RJ) changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rimvydas.jas at gmail dot = com --- Comment #4 from Rimvydas (RJ) --- (In reply to ripero84 from comment #0) > In the presence of -pedantic, -fallow-argument-mismatch fails to degrade = the > mismatch errors to warnings: >=20 > 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 is= sue > warnings. This made many projects just simply remove -pedantic[-errors] and -Werror[= =3Dfoo] from building recipes for newer gfortran versions until behavior changes. = 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 be= ing used in the user when code compilation aborts on first file with argument mismatch even for -std=3Dlegacy -pedantic. Without going into unrelated an= d even mildly disheartening long paragraphs without useful information, most of th= is started with removal of -Wargument-mismatch option. 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. The -std=3Dlegacy already implies -fallow-argument-mismatch, so why even warn about mismatches by default? S= ame for -std=3Dgnu -fallow-argument-mismatch, user already supplied option to specifically enable the extension, because code needs it. It used to be th= at -pedantic (or -Wpedantic) was safe to use to check if some unintended delet= ed language features are present in the codebase. Now with -pedantic acting l= ike -pedantic-errors and without any support to -Wno-0 or -Wno-error=3D0 (yes, anything opt=3D=3D0 "enabled by default") it is very complicated. If you have checking scripts or tools that rely on previous behavior and you are willing to compile separate gfortran version, you could use my old WIP = that almost work as expected or at least provide a way to -Wno-error=3Dpedantic = on these. Helped me a lot until we phased out those tools.=