Lahey/GNU Fortran

-[n]chk [([a][,e][,s][,u][,x])]

Checking

Compile only. Default: -nchk

GFortran options: -Wimplicit-interface, -fcheck=bounds, -fcheck=all

Specify -chk to generate a fatal runtime error message when substring and array subscripts are out of range, and when procedure arguments do not match in type, attributes, size, or shape.

Note: Commas are optional, but are recommended for readability.

-chk Arguments

Diagnostic Checking Class Option Argument
Arguments a
Subscripts s
Increased (extra) x

Specifying -chk with no arguments is equivalent to specifying -chk (a,s). Specify -chk with any combination of a, s, and x to activate the specified diagnostic checking class.

Example

LGF myprog -chk (a,x)

instructs the compiler to activate increased runtime argument checking and increased undefined variables checking.