2.2 Options controlling Fortran dialect
The following options control the details of the Fortran dialect
accepted by the compiler:
- Specify the layout used by the source file. The free form layout
was introduced in Fortran 90. Fixed form was traditionally used in
older Fortran programs. When neither option is specified, the source
form is determined by the file extension.
- Accept all of the intrinsic procedures provided in libgfortran
without regard to the setting of -std. In particular,
this option can be quite useful with -std=f95. Additionally,
gfortran will ignore -Wnonstd-intrinsics.
- Enable special treatment for lines beginning with
in fixed form sources. If the -fd-lines-as-code option is
given they are treated as if the first column contained a blank. If the
-fd-lines-as-comments option is given, they are treated as
- Set the
DOUBLE PRECISION type to an 8 byte wide type.
- Set the default integer and logical types to an 8 byte wide type.
Do nothing if this is already the default.
- Set the default real type to an 8 byte wide type.
Do nothing if this is already the default.
- Allow `$' as a valid character in a symbol name.
- Change the interpretation of backslashes in string literals
from a single backslash character to “C-style” escape characters.
The following combinations are expanded \a, \b, \f, \n, \r, \t,
\v, \\, and \0 to the ASCII characters alert, backspace, form feed,
newline, carriage return, horizontal tab, vertical tab, backslash,
and NUL, respectively. All other combinations of a character preceded
by \ are unexpanded.
- Set the default accessibility of module entities to
Use-associated entities will not be accessible unless they are explicitly
- Set column after which characters are ignored in typical fixed-form
lines in the source file, and through which spaces are assumed (as
if padded to that length) after the ends of short fixed-form lines.
Popular values for n include 72 (the
standard and the default), 80 (card image), and 132 (corresponding
to “extended-source” options in some popular compilers).
n may also be `none', meaning that the entire line is meaningful
and that continued character constants never have implicit spaces appended
to them to fill out the line.
-ffixed-line-length-0 means the same thing as
- Set column after which characters are ignored in typical free-form
lines in the source file. The default value is 132.
n may be `none', meaning that the entire line is meaningful.
-ffree-line-length-0 means the same thing as
- Specify the maximum allowed identifier length. Typical values are
31 (Fortran 95) and 63 (Fortran 2003).
- Specify that no implicit typing is allowed, unless overridden by explicit
IMPLICIT statements. This is the equivalent of adding
implicit none to the start of every procedure.
- Enable the Cray pointer extension, which provides C-like pointer
- Enable the OpenMP extensions. This includes OpenMP
in free form
!$omp directives in fixed form,
!$ conditional compilation sentinels in free form
!$ sentinels in fixed form,
and when linking arranges for the OpenMP runtime library to be linked
in. The option -fopenmp implies -frecursive.
- Disable range checking on results of simplification of constant
expressions during compilation. For example, GNU Fortran will give
an error at compile time when simplifying
a = 1. / 0.
With this option, no error will be given and
a will be assigned
+Infinity. If an expression evaluates to a value
outside of the relevant range of [
then the expression will be replaced by
DATA i/Z'FFFFFFFF'/ will result in an integer overflow
on most systems, but with -fno-range-check the value will
“wrap around” and
i will be initialized to -1 instead.
- Specify the standard to which the program is expected to conform, which
may be one of `f95', `f2003', `gnu', or `legacy'.
The default value for std is `gnu', which specifies a
superset of the Fortran 95 standard that includes all of the extensions
supported by GNU Fortran, although warnings will be given for obsolete
extensions not recommended for use in new code. The `legacy' value
is equivalent but without the warnings for obsolete extensions, and may
be useful for old non-standard programs. The `f95' and
`f2003' values specify strict conformance to the Fortran 95 and
Fortran 2003 standards, respectively; errors are given for all
extensions beyond the relevant language standard, and warnings are given
for the Fortran 77 features that are permitted but obsolescent in later