Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ flint(1) — HP-UX 6.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

f77(1)

lint(1)

make(1)

FLINT(1)  —  HP-UX

Series 300 Only

NAME

flint - FORTRAN inter-procedural checker

SYNOPSIS

flint [ -p ] [ -u ] [ -V ] [ -lx ] [ -f flistfile ] [ -c ] [ -o lib] [ f77 options ] file ... 

DESCRIPTION

Flint detects uses of the FORTRAN language that are likely to be defects, non-portable, or wasteful.  Particular attention is paid to mismatches between the calls and the definitions of FUNCTIONs and SUBROUTINEs, COMMON block differences, and the use of uninitialized variables. 

Among the problems that flint detects are:

*Unused variables (declared but never referenced)

*Variables uninitialized (undefined) at the time of reference

*Unreferenced labels

*Mismatches in the number and types of formal and actual arguments to FUNCTIONs and SUBROUTINEs

*Mismatches in the expected and actual return value of FUNCTIONs

*CALLs of FUNCTIONs, and the use of SUBROUTINEs in expressions

*COMMON block layout differences

Flint can also generate the following information:

*Call graph (which procedures call which procedures)

*List of procedures referenced but not defined in the source made available to flint

Arguments whose names end with .f are taken to be FORTRAN source files.  Arguments whose names end with .lf are taken to be the result of an earlier invocation of flint with either the -c or -o option used.  In addition, the -f flistfile option can be used to name a file containing a list of file names (one per line) to check.  Flint produces a warning if a file with any other suffix is specified. 

Flint takes all .f, .lf, and fllib-lx.lf files (specified by -lx) and processes them in their command line order.  By default, flint appends the standard FORTRAN lint library (fllib-lc.lf) to the end of the file list.  If the -c option is not used, the second pass of flint checks this list of files for mutual compatibility.  When the -c option is used, the .lf and fllib-lx.lf files are ignored. 

Any number of flint options can be used, in any order, intermixed with file name arguments.  The following options are used to change the type of output produced by flint:

Options

-p Print a call graph of the program.  The call graph consists of a list of those procedures called by each procedure and a list of those procedures which call that procedure. 

-u Suppress complaints about FUNCTIONs and SUBROUTINEs that are defined but not used, or used but not defined.  This option is useful when running flint on a subset of files of a larger program. 

-V Suppress complaints about uninitialized variables.  Detection of uninitialized variables takes considerable time and space.  This option is useful for ‘quick checks’ of FORTRAN programs. 

The following arguments alter flint’s behavior:

-lx Add a predefined flint library fllib-lx.lf.  For example, you can include a version of the flint math library fllib-lm.lf by inserting -lm on the command line.  This argument does not suppress the default use of fllib-lc.lf. 

-f flistfile Check the files listed in the file named flistfile.  The file names in flistfile must be specified one per line, and can be either .f or .lf files. 

-c Cause flint to produce a .lf file for every .f file on the command line.  These .lf files are the product of flint’s first pass only, and are not checked for inter-procedural compatibility or uninitialized variables. 

-o libCause flint to produce a flint library named fllib-llib.lf.  The -c option nullifies any use of the -o option.  The flint library produced is the input that would be given to flint’s second pass.  The -o option simply causes this file to be saved in the named flint library.  Note that, in order to reduce the size of the flint libraries, the data required for uninitialized variable detection is not written if the -o option is given. 

The -a, -A, -C, -D, -g, -G, -I, -K, -L, -n, -N, -O, -q, -Q, -s, -S, -v, -w, -W, and all +opt options of f77(1) are also recognized as separate arguments;  however, the -C, -g, -G, -K, -n, -N, -O, -q, -Q, and -s options are ignored.  This makes flint’s option list similar to that of the f77(1) command, facilitating its use in makefiles in place of the f77 command. 

Flint is a two-pass process.  The first pass operates on a per-source-file basis.  Syntax and other compiler errors are produced at this point.  If all source files are processed without error and the -c and -o options are not specified, flint starts the second pass.  It prints the message "Beginning inter-procedural checking" and performs the desired inter-procedural checks.  The behavior of the -c and -o options allows for incremental use of flint on a set of FORTRAN source files. 

Generally, flint is invoked once for each source file with the -c option.  Each invocation produces a .lf file that corresponds to the .f file, and prints diagnostics for that source file.  After all the source files have been run separately through flint, one should invoke it once more (without the -c option), listing all of the .lf files.  This will detect all of the inter-procedural inconsistencies.  This scheme works well with make(1); it allows make to use flint on only those source files that have been modified since the last time the set of source files were run through flint. 

WARNINGS

The algorithm that flint uses to detect uninitialized variables does not recognize EQUIVALENCE statements, nor can it follow assigned GOTO statements; therefore, flint might occasionally make the incorrect claim that a variable is uninitialized.  Flint also does not attempt to decipher variable FORMAT expressions; uninitialized variables used in variable FORMAT expressions are not detected. 

DEPENDENCIES

Currently, flint utilizes a special version of the Series 300 FORTRAN compiler front end; therefore, it only runs on the Series 300. 

FILES

/usr/lib/fllib-lx.lf Flint libraries that may be specified by the -lx option

/usr/lib/flint1 First pass of flint

/usr/lib/flint2 Actual inter-procedural checking program

/usr/tmp/*lint* Temporary files

SEE ALSO

f77(1), lint(1), make(1). 

Hewlett-Packard Company  —  May 11, 2021

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026