https://gcc.gnu.org/bugzilla/show_bug.cgi?id=30929
Harald Anlauf <anlauf at gmx dot de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |anlauf at gmx dot de --- Comment #8 from Harald Anlauf <anlauf at gmx dot de> --- The following patch produces the desired error for the example of comment #0: --- gcc/fortran/primary.c (revision 232904) +++ gcc/fortran/primary.c (working copy) @@ -1698,7 +1698,9 @@ } } - if (!gfc_notify_std (GFC_STD_GNU, "argument list function at %C")) + if (!gfc_notify_std (GFC_STD_GNU, "argument list function at %C") || + (pedantic && + !gfc_warning (OPT_Wpedantic, "Extension: argument list function at %C"))) { m = MATCH_ERROR; goto cleanup; % gfc-trunk -c -Werror=pedantic gcc/testsuite/gfortran.dg/c_by_val_4.f gcc/testsuite/gfortran.dg/c_by_val_4.f:14:22: CALL DOIT( %VAL( P ) ) ! { dg-warning "Extension: argument list function" } 1 Error: Extension: argument list function at (1) [-Werror=pedantic] gcc/testsuite/gfortran.dg/c_by_val_4.f:16:22: CALL DOIT( %VAL( P ) ) ! { dg-warning "Extension: argument list function" } 1 Error: Extension: argument list function at (1) [-Werror=pedantic] A more general solution might be to extend gfc_notify_std to generally handle extensions.