When two modules with the PRIVATE attribute define matching interfaces, pgfortran produces a severe error and terminates.
pgfortran 14.10-0 64-bit target on Apple OS/X -tp sandybridge
$ pgfortran -c iso_instrinsic.f90
PGF90-S-0087-Non-constant expression where constant expression required (iso_instrinsic.f90: 21)
PGF90-S-0081-Illegal selector - KIND parameter has unknown value for data type (iso_instrinsic.f90: 21)
0 inform, 0 warnings, 2 severes, 0 fatal for n
The two modules, m and n, are identical except that n USES m. The error manifests itself as confusion over the definition of c_double from the ISO_C_BINDING module.
All other compilers in my arsenal correctly compile the following code:
module m
implicit none
private
interface
real(c_double) function frick(x) BIND(C)
use, intrinsic :: iso_c_binding
implicit none
real(c_double), intent(in) :: x(*)
end function
end interface
end module
module n
use m
implicit none
private
interface
real(c_double) function frack(x) BIND(C)
use, intrinsic :: iso_c_binding
implicit none
real(c_double), intent(in) :: x(*)
end function
end interface
end module
Adding “use, intrinsic :: iso_c_binding” at the module level in n makes the error go away, but that is just weird (and should be unnecessary).
Thanks.