Next: Preprocessing Options, Previous: Option Summary, Up: Invoking GNU Fortran
The following options control the details of the Fortran dialect accepted by the compiler:
-ffree-form
-ffixed-form
-fall-intrinsics
EXTERNAL
.
-fallow-argument-mismatch
Using this option is strongly discouraged. It is possible to
provide standard-conforming code which allows different types of
arguments by using an explicit interface and TYPE(*)
.
-fallow-invalid-boz
-fd-lines-as-code
-fd-lines-as-comments
d
or D
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
comment lines.
-fdec
Other flags enabled by this switch are: -fdollar-ok -fcray-pointer -fdec-char-conversions -fdec-structure -fdec-intrinsic-ints -fdec-static -fdec-math -fdec-include -fdec-blank-format-item -fdec-format-defaults
If -fd-lines-as-code/-fd-lines-as-comments are unset, then
-fdec also sets -fd-lines-as-comments.
-fdec-char-conversions
DATA
statements
for non-character variables.
-fdec-structure
STRUCTURE
and RECORD
as well as UNION
,
MAP
, and dot ('.') as a member separator (in addition to '%'). This is
provided for compatibility only; Fortran 90 derived types should be used
instead where possible.
-fdec-intrinsic-ints
-fdec-math
-fdec-static
-fdec-include
-fdec-format-defaults
-fdec-blank-format-item
-fdollar-ok
IMPLICIT
statements is also rejected.
-fbackslash
\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.
Additionally, \x
nn, \u
nnnn and
\U
nnnnnnnn (where each n is a hexadecimal digit) are
translated into the Unicode characters corresponding to the specified code
points. All other combinations of a character preceded by \ are
unexpanded.
-fmodule-private
PRIVATE
.
Use-associated entities will not be accessible unless they are explicitly
declared as PUBLIC
.
-ffixed-line-length-
n-fno-pad-source
, 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
-ffixed-line-length-none.
-fno-pad-source
-ffree-line-length-
n-fmax-identifier-length=
n-fimplicit-none
IMPLICIT
statements. This is the equivalent of adding
implicit none
to the start of every procedure.
-fcray-pointer
-fopenacc
!$acc
directives in free form and c$acc
, *$acc
and
!$acc
directives in fixed form, !$
conditional
compilation sentinels in free form and c$
, *$
and
!$
sentinels in fixed form, and when linking arranges for the
OpenACC runtime library to be linked in.
-fopenmp
!$omp
directives
in free form
and c$omp
, *$omp
and !$omp
directives in fixed form,
!$
conditional compilation sentinels in free form
and c$
, *$
and !$
sentinels in fixed form,
and when linking arranges for the OpenMP runtime library to be linked
in. The option -fopenmp implies -frecursive.
-fno-range-check
a = 1. / 0
.
With this option, no error will be given and a
will be assigned
the value +Infinity
. If an expression evaluates to a value
outside of the relevant range of [-HUGE()
:HUGE()
],
then the expression will be replaced by -Inf
or +Inf
as appropriate.
Similarly, 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.
-fdefault-integer-8
42
. Unlike
-finteger-4-integer-8, it does not promote variables with explicit
kind declaration.
-fdefault-real-8
1.0
. This option promotes
the default width of DOUBLE PRECISION
and double real constants
like 1.d0
to 16 bytes if possible. If -fdefault-double-8
is given along with fdefault-real-8
, DOUBLE PRECISION
and double real constants are not promoted. Unlike -freal-4-real-8,
fdefault-real-8
does not promote variables with explicit kind
declarations.
-fdefault-real-10
1.0
. This option promotes
the default width of DOUBLE PRECISION
and double real constants
like 1.d0
to 16 bytes if possible. If -fdefault-double-8
is given along with fdefault-real-10
, DOUBLE PRECISION
and double real constants are not promoted. Unlike -freal-4-real-10,
fdefault-real-10
does not promote variables with explicit kind
declarations.
-fdefault-real-16
1.0
. This option promotes
the default width of DOUBLE PRECISION
and double real constants
like 1.d0
to 16 bytes if possible. If -fdefault-double-8
is given along with fdefault-real-16
, DOUBLE PRECISION
and double real constants are not promoted. Unlike -freal-4-real-16,
fdefault-real-16
does not promote variables with explicit kind
declarations.
-fdefault-double-8
DOUBLE PRECISION
type and double real constants
like 1.d0
to an 8 byte wide type. Do nothing if this
is already the default. This option prevents -fdefault-real-8,
-fdefault-real-10, and -fdefault-real-16,
from promoting DOUBLE PRECISION
and double real constants like
1.d0
to 16 bytes.
-finteger-4-integer-8
INTEGER(KIND=4)
entities to an INTEGER(KIND=8)
entities. If KIND=8
is unavailable, then an error will be issued.
This option should be used with care and may not be suitable for your codes.
Areas of possible concern include calls to external procedures,
alignment in EQUIVALENCE
and/or COMMON
, generic interfaces,
BOZ literal constant conversion, and I/O. Inspection of the intermediate
representation of the translated Fortran code, produced by
-fdump-tree-original, is suggested.
-freal-4-real-8
-freal-4-real-10
-freal-4-real-16
-freal-8-real-4
-freal-8-real-10
-freal-8-real-16
REAL(KIND=M)
entities to REAL(KIND=N)
entities.
If REAL(KIND=N)
is unavailable, then an error will be issued.
The -freal-4-
flags also affect the default real kind and the
-freal-8-
flags also the double-precision real kind. All other
real-kind types are unaffected by this option. The promotion is also
applied to real literal constants of default and double-precision kind
and a specified kind number of 4 or 8, respectively.
However, -fdefault-real-8
, -fdefault-real-10
,
-fdefault-real-10
, and -fdefault-double-8
take precedence
for the default and double-precision real kinds, both for real literal
constants and for declarations without a kind number.
Note that for REAL(KIND=KIND(1.0))
the literal may get promoted and
then the result may get promoted again.
These options should be used with care and may not be suitable for your
codes. Areas of possible concern include calls to external procedures,
alignment in EQUIVALENCE
and/or COMMON
, generic interfaces,
BOZ literal constant conversion, and I/O and calls to intrinsic procedures
when passing a value to the kind=
dummy argument. Inspection of the
intermediate representation of the translated Fortran code, produced by
-fdump-fortran-original or -fdump-tree-original, is suggested.
-std=
std-ftest-forall-temp