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

Explicit interfaces with generated .mod files ?

dbruceg
Beginner
592 Views

Steve:

You mentioned a while back that the generated .mod files are to be used for error checking only, or something like that. It appears that they should not be used for required interfaces, such as between routines that pass pointers as pointers. Strangely, though, the generated .mod files seem to work for that purpose until some mysterious phenomenon apparently related to the DLL complexity occurs, whereupon some (but not all) of the calls begin to fail. Am I reading this right? When an interface is required, one cannot trust the generated .mod files?

Bruce

0 Kudos
3 Replies
Steven_L_Intel1
Employee
592 Views
There is a bug, which I have reported to development, that in some cases where an explicit interface would be required, a generated interface "satisfies" that requirement when the correct behavior should be that an error is given saying that an interface is required. The compiler should never use a generated interface for anything more than error checking.

The generated .mod file can be "trusted" in that it will, for now, make the program work (when it shouldn't). At some point in the future, the compiler will give a proper error instead.
0 Kudos
dbruceg
Beginner
592 Views

If a called subroutine is a contained module procedure, is an explicit interface automatically defined by the USE statement in the calling routine? If not, can one stick the interface in the module? i.e.,

subroutine Caller

use PointerPassers_

call PointerPasser_1 (pntr)

return

end

module PointerPassers_

interface subroutine PointerPassers_1 (pntr)

...

end interface

contains

subroutine PointerPasser_1

...

end module PointerPassers_

Bruce

0 Kudos
Steven_L_Intel1
Employee
592 Views
A contained procedure is its own explicit interface and adding a separate interface block would be incorrect. A simple USE of the module is sufficient.
0 Kudos
Reply