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

Interface between subroutines (error checking)

Intel_C_Intel
Employee
1,498 Views

Hello;

I was putting together some subroutine and function calls, and got some strange results.

Then I happened to notice that the arguments did not match. In one case, the number of arguments was different. I was wondering why the linker would not detect an error like that. In the old CVF development system ittold you right away if there was any kind of mismatch, or would give an "external not found" message. C++ does that also, right?

I realize that in this newer environment we can have optional arguments, but if I'm not using that feature, how can I make the linker test for matching types and number of arguments? The compiler didn't notice the incompatitbility even when they were in the same source code block.

Maybe there's a article somewhere I can read?

Thanks; Bill

0 Kudos
2 Replies
TimP
Honored Contributor III
1,498 Views
Did you search for the posts on warn:intefaces ?
0 Kudos
Steven_L_Intel1
Employee
1,498 Views
There are two switches which, used together, do what you want.

/gen-interfaces /warn:interfaces

The first says to generate a module with an interface block for any procedure. The second says to look for such blocks if a procedure reference has an implicit interface. The feature is not perfect, but it works pretty well in most cases.
0 Kudos
Reply