- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There is: -warn interfaces
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page