Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28499 Discussions

Why does -warn interfaces not issue warning even if an external subroutine does not have interface?

New Contributor I

I am using ifort 18.0.0 and I am trying to make it check the presence of explicit interfaces in my codes. My interfaces are placed in module mymod contained in file mymod.f90. In a procedure somesub, a call to another procedure mysub is made. The interface for mysub is inside mymod module.  The codes are more or less like the following.




module mymod
  use, intrinsic :: iso_c_binding
  implicit none
     subroutine mysub(a)
       integer(c_long) :: a
     end subroutine mysub
  end interface
end module mymod






subroutine somesub()
  use, intrinsic :: iso_c_binding
  use mymod, only : mysub
  implicit none
  integer(c_long) :: a = 1
  call mysub(a)
end subroutine somesub



somesub() is an external procedure.

And my compile command is



ifort -warn interfaces -nogen-interfaces -mkl -I../MOD/ -c somesub.f90



 MOD is the directory where mymod.f90, mymod.o, and mymod.mod are. When the ''use mymod, only : mysub'' line in somesub.f90 is commented out, it should be oblivious of the presence of mysub interface, yet ifort doesn't give any warning nor error.

0 Kudos
0 Replies