This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: detecting interface mismatches
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: Damian Rouson <damian at sourceryinstitute dot org>, g at troutmask dot apl dot washington dot edu
- Cc: GCC-Fortran-ML <fortran at gcc dot gnu dot org>, Paul Richard Thomas <paul dot richard dot thomas at gmail dot com>
- Date: Fri, 7 Oct 2016 13:01:40 -0700
- Subject: Re: detecting interface mismatches
- Authentication-results: sourceware.org; auth=none
- References: <B3163619-708A-4227-B95E-9FA6D77C5217@sourceryinstitute.org>
- Reply-to: kargl at uw dot edu
On Fri, Oct 07, 2016 at 12:49:57PM -0700, Damian Rouson wrote:
> All,
>
> gfortran does not detect mismatches between a function
> implementation a submodule and the corresponding
> interface body in the parent module? See below. I have
> not checked the standard for a corresponding constraint
> to determine whether the compiler is required to catch
> such a mismatch, but if it’s not required, it would be
> a great feature to have. This problem was identified
> by a student in a course I’m teaching.
>
> Damian
>
> $ cat one.f90
> module one_module
> implicit none
This 'implicit none' does ...
> interface
not make it into the interface, so you should add
> module function one()
implicit none ! here.
> end function
> end interface
> end module
Then it becomes easy to prevent the interface mismatch.
--
Steve