This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch, fortran] Fix PR 91390 - treatment of extra parameter in a subroutine call
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: Thomas König <tk at tkoenig dot net>
- Cc: "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 24 Aug 2019 10:18:37 -0700
- Subject: Re: [patch, fortran] Fix PR 91390 - treatment of extra parameter in a subroutine call
- References: <81d346ae-3da0-d082-234d-a0cc64050a7e@tkoenig.net>
- Reply-to: sgk at troutmask dot apl dot washington dot edu
On Tue, Aug 20, 2019 at 10:32:37PM +0200, Thomas König wrote:
>
> 2019-08-20 Thomas Koenig <tkoenig@gcc.gnu.org>
>
> PR fortran/91390
> * frontend-passes.c (check_externals_procedure): New
> function. If a procedure is not in the translation unit, create
> an "interface" for it, including its formal arguments.
> (check_externals_code): Use check_externals_procedure for common
> code with check_externals_expr.
> (check_externals_expr): Vice versa.
> * gfortran.h (gfc_get_formal_from_actual-arglist): New prototype.
> (gfc_compare_actual_formal): New prototype.
> * interface.c (compare_actual_formal): Rename to
> (gfc_compare_actual_forma): New function, make global.
spelling. forma -> formal
>
> 2019-08-20 Thomas Koenig <tkoenig@gcc.gnu.org>
>
> PR fortran/91390
> * gfortran.dg/bessel_3.f90: Add type mismatch errors.
> * gfortran.dg/coarray_7.f90: Rename subroutines to avoid
> additional errors.
> * gfortran.dg/g77/20010519-1.f: Add -std=legacy. Remove
> warnings for ASSIGN. Add warnings for type mismatch.
> * gfortran.dg/goacc/acc_on_device-1.f95: Add -std=legacy.
> Add cath-all warning.
spelling. cath -> catch
OK. Thanks for taking on this task.
As to the open question about how to handle this check,
I would create -fallow-argument-mismatch (or whatever
option name you like). gfortran issues an error if
a mismatch is detected. -fallow-... would reduce the
error to warning, which can only be silenced with -w.
Hopefully, this will encourage users to fix the code.
--
steve