Use of undefined variables can be detected with the -C=undefined option. Program units compiled with this option use a different ABI, which means that they are incompatible with program units compiled without this option, and not interoperable with C; thus the whole program must be Fortran code and compiled the same way. For this reason, -C=undefined is not part of -C or -C=all.
Currently, there are a number of other limitations on the use of -C=undefined.
COMMON
.
ISO_C_BINDING
module can
only be used with all-Fortran programs as the option makes changes to the ABI.
READ
from a CHARACTER
array requires the
entire specified array subobject to be “defined”, even those elements
corresponding to records not actually read.
WRITE
to a CHARACTER
array is considered
to define the entire specified array subobject, even those elements
corresponding to records not actually written.
PAD
argument to RESHAPE
when no padding is actually required, and elements of the ARRAY
argument to PACK
that correspond to false elements of
the MASK
.
CLASS(*)
variables are allocated using the
MOLD=
specifier.
ALLOCATE
when the SOURCE=
expression
is a CLASS(*)
dummy and the actual argument is a constant.