FPT and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Reference Manual Home |


CHECK ARGUMENTS

Syntax:

CHECK ARGUMENTS [ <sub-program_name> ]...

Function:

Checks that the actual arguments passed to subroutines and functions are consistent with the formal arguments. An inconsistency is reported if the number of actual arguments passed in a sub-program call differs from the number of formal arguments, or if an actual argument differs from the corresponding formal argument in respect of:

  1. Intent: whether the argument is read or written by the sub-program. The intent must conform with the INTENT declaration, if any, and if the intent is OUT or INOUT, the argument must be writeable: it may not be a constant or an expression.

  2. Usage: FPT distinguishes between arguments which are variables array elements, whole arrays, sub-program names or statement labels.

  3. Data Type: Logical, integer, real, complex or a specific derived type or structure.

  4. Data Size or kind: The number of bytes occupied by each element of the object (e.g. INTEGER*1, INTEGER*2, INTEGER*4 or INTEGER*8). The data size of an object is inferred from the system defaults if no size is specified explicitly. The default sizes are set by commands to FPT of the form DEFAULT INTEGER SIZE = n .

  5. Array Bounds. The bounds must conform, but need not match exactly as part of an array may be passed as an argument.

If the code of a sub-program is not available, FPT compares different calls to the sub-program and reports inconsistencies between them.

CHECK ARGUMENTS written without a list of sub-program names instructs FPT to check the arguments of all sub-program calls in a program.

The sensitivity of the check is controlled by the commands:

ARGUMENT CHECK TO {CHECK|IGNORE} DEFAULT SIZES

- controls reporting of an inconsistency where the data sizes of the objects are consistent, but the size is declared explicitly in one case, ( e.g. REAL*4 X ) and is inferred from the system defaults in another, ( e.g. REAL X ).

ARGUMENT CHECK TO {CHECK|IGNORE} ARRAY BOUNDS

- controls reporting of inconsistent array bounds between the actual and formal arguments. This does not necessarily indicate an error. There are many occasions where it is convenient to pass part of an array as an argument. FPT does not report an error if the actual argument passed to a routine is an array and the addressed sub-array conforms in rank and bounds with the formal argument.

ARGUMENT CHECK TO {CHECK|IGNORE} ARRAY RANK

- controls reporting of inconsistent array rank and bounds between the actual and formal arguments. The array rank is always considered to match if a sub-array of the actual argument at the address passed conforms in rank and bounds with the formal argument. This switch controls reporting of the situation where the rank of the formal argument is greater than the rank of the actual argument and the array is re-mapped across the sub-program call interface.

ARGUMENT CHECK TO {CHECK|IGNORE} CHARACTER SIZES

- controls reporting of character arguments of inconsistent lengths. Character arguments are usually passed by descriptor, of by the address and length passed as separate elements on the system stack. No error usually occurs where the lengths are inconsistent. However, some systems do not check that the lengths of the actual and formal arguments match, and data may then be overwritten or passed incompletely.

ARGUMENT CHECK TO {CHECK|IGNORE} ALL

- turns reporting on or off for all of the optional cases listed above.

The command CORRECT INCONSISTENT ARGUMENTS instructs FPT automatically to correct some classes of inconsistent arguments.

Where to use this command:

Operating system command line

Yes


Configuration file, config.fsp

Yes


Specification (FSP) files, *.fsp

Yes


Interactively, to FPT> prompt:

Yes


Interactive command files

Yes


Embedded in the Fortran code

Yes


Default:

Arguments are not checked by default.

(Note that defaults may be changed in the configuration file)

Examples:

$ fpt %check_arguments aero.fsp ! Command line

FPT> ch arg ! Interactively.

See also:

ARGUMENT CHECK TO CHECK or TO IGNORE

CORRECT INCONSISTENT ARGUMENTS

DEFAULT SIZE


Copyright ©1995 to 2014 Software Validation Ltd. All rights reserved.