This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: detecting interface mismatches


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]