Quantcast
Channel: Intel® Fortran Compiler
Viewing all articles
Browse latest Browse all 3270

Compiler does not flag the type mismatch in FUNCTION statement

$
0
0

I apologize if this is a known issue and being worked on, but I failed to locate any relevant thread on this.

module mykinds_m

   use, intrinsic :: iso_fortran_env, only : I2 => int16, I4 => int32

   implicit none

end module mykinds_m

module m

   use mykinds_m, only : I2, I4

   implicit none

   interface

      function f( i ) result(RetVal)

         import :: I4, I2

         !.. Argument list
         integer(I4), intent(in) :: i
         !.. Function result
         integer(I2) :: RetVal

      end function f

   end interface

end module m

module n

   use mykinds_m, only : I2, I4

   use m, only : f

   implicit none

   integer(I2), parameter :: i = 0

contains

   subroutine foo()

      integer(I4) :: j

      j = f( i )  !.. Note the type mismatch in argument as well as result

   end subroutine foo

end module n
Compiling with Intel(R) Visual Fortran Compiler 16.0.1.146 [Intel(R) 64]...
m.f90

m - 0 error(s), 0 warning(s)

 


Viewing all articles
Browse latest Browse all 3270

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>