fpt and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Ref Manual Home |

CHECK DEFAULT SIZES

Syntax:

CHECK DEFAULT SIZES IGNORE DEFAULT SIZES

Function:

The commands CHECK DEFAULT SIZES and IGNORE DEFAULT SIZES deal with the situation where a variable is declared with an explicit data size or kind in one sub-program and declared without an explicit size or kind in another. For example:

SUBROUTINE VECMAT INTEGER(KIND=4) VECLEN COMMON /VEC/ VECLEN : SUBROUTINE DETERM INTEGER VECLEN COMMON /VEC/ VECLEN :

If the default size of an integer variable is 2 bytes or 8 bytes, fpt will always recognise that the two versions of VECLEN are different objects. The default sizes for the data types are set by commands of the form DEFAULT LOGICAL SIZE etc.

If the default integer size is 4 bytes in this example, VECLEN is the same in both subroutines. However, there is a maintenance trap. If the code is moved to a system with a different default integer size, the two copies of VECLEN are no longer equivalent, and an error will probably occur. fpt treats the objects as different if CHECK DEFAULT SIZES is specified, and as equivalent if IGNORE DEFAULT SIZES is specified. In this example, the name and equivalence checks report a potential problem if default sizes are checked, and do not report a problem if default sizes are ignored.

Most of the checks carried out by fpt may individually be set to ignore or to check default sizes. The commands CHECK DEFAULT SIZES and IGNORE DEFAULT SIZES control this behaviour in all contexts.

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

CHECK DEFAULT SIZES

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

See Also

CHECK EQUIVALENCE

CHECK NAMES

DEFAULT SIZE

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