detecting interface mismatches

Steve Kargl sgk@troutmask.apl.washington.edu
Fri Oct 7 23:25:00 GMT 2016


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



More information about the Fortran mailing list