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

Priority between module procedure and external procedure

netphilou31
New Contributor III
559 Views
Hi all,

I have just a simple question I am almost sure of the answer but wanted to have your comments on it.
What is the priority between a module procedure called "A" and a procedure "A" belonging to the same project ? I guess that for routines using the module and calling the routine "A" this is the routine belonging to the module which is called and for the other, the local routine "A" is called. It is probably due to a bad programing but I have discovered this problem when converting an old CVF project. I guess that the linker has no problem for building the target because one object is named _mp_A and the second is just named "A".

Best regards,

Phil.
0 Kudos
2 Replies
Arjen_Markus
Honored Contributor II
559 Views
A procedure (program unit, subroutine, function, ...) in a module is only visible if its module is USEd
(directly or indirectly). Then it takes "precedence", if that is the right word, over any procedure by the
same name that is outside any module. There may be a conflict with intrinsic procedures. Not sure how
that is dealt with.

The linker indeed only gets these decorated names, so it does not have to know anything about modules.

Regards,

Arjen
0 Kudos
netphilou31
New Contributor III
559 Views
Hi,
Thanks for your reply. This is what I was expecting but wanted to be sure.
Regards,
Phil.
0 Kudos
Reply