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.