* Submodule/module interface mismatch: is this standard-conforming?
@ 2016-10-08 15:19 Damian Rouson
0 siblings, 0 replies; only message in thread
From: Damian Rouson @ 2016-10-08 15:19 UTC (permalink / raw)
To: j3; +Cc: GCC-Fortran-ML
All,
Is the program below standard-conforming? The Cray compiler gives an error message stating that the IMPLICIT NONE disallows the implicitly typed interface body and and a second error message reporting a conflict between the interface body and and the module function in the submodule. This is the behavior I would hope would be the intention of the standard, but I’m not certain it is the standard behavior.
The gfortran 6.1.0 compiler compiles the program without errors and prints the following:
9.18340949E-41 is not 1
The Intel 16.0 compiler compiles the program without errors and prints the following:
1.000000 is not 1
Despite my hopes, I suspect the interface body is standard-conforming on the grounds that the IMPLICIT statement does not apply to the interface block. Nonetheless, I suspect that having an interface body that refers to a procedure with the same names as a different procure in the a child submodule makes the program non-conforming.
Damian
module one_module
implicit none
interface
module function one()
end function
end interface
end module
submodule(one_module) one_submodule
implicit none
contains
integer module function one()
one = 1
end function
end submodule
use one_module
print *,one()," is not ",1
end
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-10-07 23:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-08 15:19 Submodule/module interface mismatch: is this standard-conforming? Damian Rouson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).