Quantcast
Channel: Intel® Software - Intel® Fortran Compiler for Linux* and macOS*
Viewing all articles
Browse latest Browse all 2746

Q about name conflict with intrinsic function

$
0
0

Hello,

What happens when module defines function or interface using the conflicting name of standard Fortran function (say RANDOM_NUMBER):

module tm

interface random_number
module procedure my_random_number(
... ! other overloaded versions here (name the same)
end interface

contains

subroutine my_random_number(dph)
double precision,intent(out)::dph
...
end subroutine random_number(dph)

...

end module tm

and then this module is to be used in say main unit:

program t
use tm
double_precision::dprn
call random_number(dpm)
...
end program t

What compiler and linker finally do in this conflicting situation? Are there any standard rules about it?
Is there any syntax to avoid the problem (like fully qualified names in Java)?

PS. Q is stupid, but this is the real code I have from 3rd party...


Viewing all articles
Browse latest Browse all 2746

Latest Images

Trending Articles



Latest Images

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