From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D9D323858413; Sun, 12 Sep 2021 19:22:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D9D323858413 From: "kargl at gcc dot 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 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: kargl at gcc dot gnu.org 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: Sun, 12 Sep 2021 19:22:56 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102145 --- 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 degrad= e 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, misma= tch > > warnings are upgraded to errors, despite -pedantic is only supposed to = issue > > warnings. >=20 > This made many projects just simply remove -pedantic[-errors] and > -Werror[=3Dfoo] 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 depreca= ted > and/or deleted features are being used in the user when code compilation > aborts on first file with argument mismatch even for -std=3Dlegacy -pedan= tic. 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.=20=20 > While it is understandable why it was done like this from compiler develo= per > 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.=