Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner

check arguments of called subroutines

Hi all,

I am wondering if there is a compiler option which enables to check arguments of call subroutines/functions while compiling (argument numbers or event types). Or maybe a run time tool activated with a flag ? My main purpose is to check if no argument is missing in source lines while calling a subroutine or a function.

Thanks & Best Regards.
Thierry

0 Kudos
4 Replies
Highlighted

There is: -warn interfaces

There is: -warn interfaces

Retired 12/31/2016
0 Kudos
Highlighted
Beginner

Thank you very much for the

Thank you very much for the quick reply.

I tested and compiler is aborting due to an argument type which differs.
Is there a way to skip type checking and only check argument numbers ?

Thanks and Best Regards
Thierry

0 Kudos
Highlighted

Argument type mismatch is

Argument type mismatch is just as bad and number of argument mismatches. You really should correct both types of errors.

This said, some older routines may have you passing a scalar (e.g. reference to 1st element of an array), and where the code then subsequently references the dummy scalar with a subscript. You should take the time to clean this up. You may find some hidden errors in your code. It is not unusual to find yourself asking "How did this ever run?".

Jim Dempsey

0 Kudos
Highlighted

You do understand that a

You do understand that a mismatched type is still an error, yes? And can lead to wrong results if not careful?

You could add, in the routine being called:

!DIR$ ATTRIBUTES NO_ARG_CHECK :: name-of-dummy-argument

This will disable type and shape checking for that one argument.

Better is to correct the program to not have such mismatches.

Retired 12/31/2016
0 Kudos