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

Misleading error report: Excess arguments in a subroutine call

john_humble
Beginner
1,030 Views

This is ridiculous. Anew subroutine I'm developing had five dummy arguments during the initial test phase. The final design requiresseven dummy arguments; however whenever I try to add the sixth and/or the seventh the IVF compiler comes up with "Error: The number of actual arguments cannot be greater than the number of dummy arguments".

I totally agree; my problem is that this isn't the case. The error is clearly something else. The first five dummy args are, respectively, character*80, character*80, character*3, character*3 and integer. I've stripped all code other than the declarations out of both the subroutine and the outer sub that calls it (apart from the call to the inner sub )and have also completely retyped both the subdeclaration lineand the call, in case any non-printing characters had crept in. I also tried chaging character*3 to character*4 (desperation change) but that didn't change anything. I've got to be looking at something simple but can't see it. I'd appreciate any suggestions.

TIA John

0 Kudos
4 Replies
TimP
Honored Contributor III
1,030 Views
Did you check whether this is related to interface check files left in the debug directory from earlier builds? If you search on clean interface checks or the like, you will see some hints, in case you have run into a similar problem.
0 Kudos
bmchenry
New Contributor II
1,030 Views
1) the error is in the 'subroutine call' so after you change your subroutine to add the additional arguments, do you also change the calls to the subroutine?
2) before compile, try the Build->Clean Solution
3)are you using 'generate Interface' option of Project->(your project) Properties->Fortran->Diagnostics->Generate Interface Blocks?

and which version of the compiler are you using? (since 3) would have generated a different problem with 74 so I'm guessing you are using 72 or earlier?

0 Kudos
john_humble
Beginner
1,030 Views
Quoting - bmchenry
1) the error is in the 'subroutine call' so after you change your subroutine to add the additional arguments, do you also change the calls to the subroutine?
2) before compile, try the Build->Clean Solution
3)are you using 'generate Interface' option of Project->(your project) Properties->Fortran->Diagnostics->Generate Interface Blocks?

and which version of the compiler are you using? (since 3) would have generated a different problem with 74 so I'm guessing you are using 72 or earlier?


0 Kudos
john_humble
Beginner
1,030 Views
1) Yes
2) That was the problem - a Clean Build fixed it.
3) No problems there
I'm using 10.1
Thanks a heap John
0 Kudos
Reply