URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [doc/] [gfortran.1] - Rev 826
Compare with Previous | Blame | View Log
.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.ie \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.el \{\
. de IX
..
.\}
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "GFORTRAN 1"
.TH GFORTRAN 1 "2010-07-31" "gcc-4.5.1" "GNU"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
gfortran \- GNU Fortran compiler
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
gfortran [\fB\-c\fR|\fB\-S\fR|\fB\-E\fR]
[\fB\-g\fR] [\fB\-pg\fR] [\fB\-O\fR\fIlevel\fR]
[\fB\-W\fR\fIwarn\fR...] [\fB\-pedantic\fR]
[\fB\-I\fR\fIdir\fR...] [\fB\-L\fR\fIdir\fR...]
[\fB\-D\fR\fImacro\fR[=\fIdefn\fR]...] [\fB\-U\fR\fImacro\fR]
[\fB\-f\fR\fIoption\fR...]
[\fB\-m\fR\fImachine-option\fR...]
[\fB\-o\fR \fIoutfile\fR] \fIinfile\fR...
.PP
Only the most useful options are listed here; see below for the
remainder.
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
The \fBgfortran\fR command supports all the options supported by the
\&\fBgcc\fR command. Only options specific to \s-1GNU\s0 Fortran are documented here.
.PP
All \s-1GCC\s0 and \s-1GNU\s0 Fortran options
are accepted both by \fBgfortran\fR and by \fBgcc\fR
(as well as any other drivers built at the same time,
such as \fBg++\fR),
since adding \s-1GNU\s0 Fortran to the \s-1GCC\s0 distribution
enables acceptance of \s-1GNU\s0 Fortran options
by all of the relevant drivers.
.PP
In some cases, options have positive and negative forms;
the negative form of \fB\-ffoo\fR would be \fB\-fno\-foo\fR.
This manual documents only one of these two forms, whichever
one is not the default.
.SH "OPTIONS"
.IX Header "OPTIONS"
Here is a summary of all the options specific to \s-1GNU\s0 Fortran, grouped
by type. Explanations are in the following sections.
.IP "\fIFortran Language Options\fR" 4
.IX Item "Fortran Language Options"
\&\fB\-fall\-intrinsics \-ffree\-form \-fno\-fixed\-form
\&\-fdollar\-ok \-fimplicit\-none \-fmax\-identifier\-length
\&\-std=\fR\fIstd\fR \fB\-fd\-lines\-as\-code \-fd\-lines\-as\-comments
\&\-ffixed\-line\-length\-\fR\fIn\fR \fB\-ffixed\-line\-length\-none
\&\-ffree\-line\-length\-\fR\fIn\fR \fB\-ffree\-line\-length\-none
\&\-fdefault\-double\-8 \-fdefault\-integer\-8 \-fdefault\-real\-8
\&\-fcray\-pointer \-fopenmp \-fno\-range\-check \-fbackslash \-fmodule\-private\fR
.IP "\fIPreprocessing Options\fR" 4
.IX Item "Preprocessing Options"
\&\fB\-cpp \-dD \-dI \-dM \-dN \-dU \-fworking\-directory
\&\-imultilib\fR \fIdir\fR \fB\-iprefix\fR \fIfile\fR \fB\-isysroot\fR \fIdir\fR
\&\fB\-iquote \-isystem\fR \fIdir\fR \fB\-nocpp \-nostdinc \-undef
\&\-A\fR\fIquestion\fR\fB=\fR\fIanswer\fR \fB\-A\-\fR\fIquestion\fR[\fB=\fR\fIanswer\fR]
\&\fB\-C \-CC \-D\fR\fImacro\fR[\fB=\fR\fIdefn\fR] \fB\-U\fR\fImacro\fR \fB\-H \-P\fR
.IP "\fIError and Warning Options\fR" 4
.IX Item "Error and Warning Options"
\&\fB\-fmax\-errors=\fR\fIn\fR
\&\fB\-fsyntax\-only \-pedantic \-pedantic\-errors
\&\-Wall \-Waliasing \-Wampersand \-Warray\-bounds \-Wcharacter\-truncation
\&\-Wconversion \-Wimplicit\-interface \-Wimplicit\-procedure \-Wline\-truncation
\&\-Wintrinsics\-std \-Wsurprising \-Wno\-tabs \-Wunderflow \-Wunused\-parameter
\&\-Wintrinsics\-shadow \-Wno\-align\-commons\fR
.IP "\fIDebugging Options\fR" 4
.IX Item "Debugging Options"
\&\fB\-fdump\-parse\-tree \-ffpe\-trap=\fR\fIlist\fR
\&\fB\-fdump\-core \-fbacktrace\fR
.IP "\fIDirectory Options\fR" 4
.IX Item "Directory Options"
\&\fB\-I\fR\fIdir\fR \fB\-J\fR\fIdir\fR \fB\-M\fR\fIdir\fR
\&\fB\-fintrinsic\-modules\-path\fR \fIdir\fR
.IP "\fILink Options\fR" 4
.IX Item "Link Options"
\&\fB\-static\-libgfortran\fR
.IP "\fIRuntime Options\fR" 4
.IX Item "Runtime Options"
\&\fB\-fconvert=\fR\fIconversion\fR \fB\-fno\-range\-check
\&\-frecord\-marker=\fR\fIlength\fR \fB\-fmax\-subrecord\-length=\fR\fIlength\fR
\&\fB\-fsign\-zero\fR
.IP "\fICode Generation Options\fR" 4
.IX Item "Code Generation Options"
\&\fB\-fno\-automatic \-ff2c \-fno\-underscoring
\&\-fwhole\-file \-fsecond\-underscore
\&\-fbounds\-check \-fcheck\-array\-temporaries \-fmax\-array\-constructor =\fR\fIn\fR
\&\fB\-fcheck=\fR\fI<all|array\-temps|bounds|do|mem|pointer|recursion>\fR
\&\fB\-fmax\-stack\-var\-size=\fR\fIn\fR
\&\fB\-fpack\-derived \-frepack\-arrays \-fshort\-enums \-fexternal\-blas
\&\-fblas\-matmul\-limit=\fR\fIn\fR \fB\-frecursive \-finit\-local\-zero
\&\-finit\-integer=\fR\fIn\fR \fB\-finit\-real=\fR\fI<zero|inf|\-inf|nan|snan>\fR
\&\fB\-finit\-logical=\fR\fI<true|false>\fR \fB\-finit\-character=\fR\fIn\fR
\&\fB\-fno\-align\-commons \-fno\-protect\-parens\fR
.Sh "Options controlling Fortran dialect"
.IX Subsection "Options controlling Fortran dialect"
The following options control the details of the Fortran dialect
accepted by the compiler:
.IP "\fB\-ffree\-form\fR" 4
.IX Item "-ffree-form"
.PD 0
.IP "\fB\-ffixed\-form\fR" 4
.IX Item "-ffixed-form"
.PD
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.
.IP "\fB\-fall\-intrinsics\fR" 4
.IX Item "-fall-intrinsics"
This option causes all intrinsic procedures (including the GNU-specific
extensions) to be accepted. This can be useful with \fB\-std=f95\fR to
force standard-compliance but get access to the full range of intrinsics
available with \fBgfortran\fR. As a consequence, \fB\-Wintrinsics\-std\fR
will be ignored and no user-defined procedure with the same name as any
intrinsic will be called except when it is explicitly declared \f(CW\*(C`EXTERNAL\*(C'\fR.
.IP "\fB\-fd\-lines\-as\-code\fR" 4
.IX Item "-fd-lines-as-code"
.PD 0
.IP "\fB\-fd\-lines\-as\-comments\fR" 4
.IX Item "-fd-lines-as-comments"
.PD
Enable special treatment for lines beginning with \f(CW\*(C`d\*(C'\fR or \f(CW\*(C`D\*(C'\fR
in fixed form sources. If the \fB\-fd\-lines\-as\-code\fR option is
given they are treated as if the first column contained a blank. If the
\&\fB\-fd\-lines\-as\-comments\fR option is given, they are treated as
comment lines.
.IP "\fB\-fdefault\-double\-8\fR" 4
.IX Item "-fdefault-double-8"
Set the \f(CW\*(C`DOUBLE PRECISION\*(C'\fR type to an 8 byte wide type. If
\&\fB\-fdefault\-real\-8\fR is given, \f(CW\*(C`DOUBLE PRECISION\*(C'\fR would
instead be promoted to 16 bytes if possible, and \fB\-fdefault\-double\-8\fR
can be used to prevent this. The kind of real constants like \f(CW\*(C`1.d0\*(C'\fR will
not be changed by \fB\-fdefault\-real\-8\fR though, so also
\&\fB\-fdefault\-double\-8\fR does not affect it.
.IP "\fB\-fdefault\-integer\-8\fR" 4
.IX Item "-fdefault-integer-8"
Set the default integer and logical types to an 8 byte wide type.
Do nothing if this is already the default. This option also affects
the kind of integer constants like \f(CW42\fR.
.IP "\fB\-fdefault\-real\-8\fR" 4
.IX Item "-fdefault-real-8"
Set the default real type to an 8 byte wide type.
Do nothing if this is already the default. This option also affects
the kind of non-double real constants like \f(CW1.0\fR, and does promote
the default width of \f(CW\*(C`DOUBLE PRECISION\*(C'\fR to 16 bytes if possible, unless
\&\f(CW\*(C`\-fdefault\-double\-8\*(C'\fR is given, too.
.IP "\fB\-fdollar\-ok\fR" 4
.IX Item "-fdollar-ok"
Allow \fB$\fR as a valid non-first character in a symbol name. Symbols
that start with \fB$\fR are rejected since it is unclear which rules to
apply to implicit typing as different vendors implement different rules.
Using \fB$\fR in \f(CW\*(C`IMPLICIT\*(C'\fR statements is also rejected.
.IP "\fB\-fbackslash\fR" 4
.IX Item "-fbackslash"
Change the interpretation of backslashes in string literals from a single
backslash character to \*(L"C\-style\*(R" escape characters. The following
combinations are expanded \f(CW\*(C`\ea\*(C'\fR, \f(CW\*(C`\eb\*(C'\fR, \f(CW\*(C`\ef\*(C'\fR, \f(CW\*(C`\en\*(C'\fR,
\&\f(CW\*(C`\er\*(C'\fR, \f(CW\*(C`\et\*(C'\fR, \f(CW\*(C`\ev\*(C'\fR, \f(CW\*(C`\e\e\*(C'\fR, and \f(CW\*(C`\e0\*(C'\fR to the \s-1ASCII\s0
characters alert, backspace, form feed, newline, carriage return,
horizontal tab, vertical tab, backslash, and \s-1NUL\s0, respectively.
Additionally, \f(CW\*(C`\ex\*(C'\fR\fInn\fR, \f(CW\*(C`\eu\*(C'\fR\fInnnn\fR and
\&\f(CW\*(C`\eU\*(C'\fR\fInnnnnnnn\fR (where each \fIn\fR is a hexadecimal digit) are
translated into the Unicode characters corresponding to the specified code
points. All other combinations of a character preceded by \e are
unexpanded.
.IP "\fB\-fmodule\-private\fR" 4
.IX Item "-fmodule-private"
Set the default accessibility of module entities to \f(CW\*(C`PRIVATE\*(C'\fR.
Use-associated entities will not be accessible unless they are explicitly
declared as \f(CW\*(C`PUBLIC\*(C'\fR.
.IP "\fB\-ffixed\-line\-length\-\fR\fIn\fR" 4
.IX Item "-ffixed-line-length-n"
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.
.Sp
Popular values for \fIn\fR include 72 (the
standard and the default), 80 (card image), and 132 (corresponding
to \*(L"extended-source\*(R" options in some popular compilers).
\&\fIn\fR may also be \fBnone\fR, meaning that the entire line is meaningful
and that continued character constants never have implicit spaces appended
to them to fill out the line.
\&\fB\-ffixed\-line\-length\-0\fR means the same thing as
\&\fB\-ffixed\-line\-length\-none\fR.
.IP "\fB\-ffree\-line\-length\-\fR\fIn\fR" 4
.IX Item "-ffree-line-length-n"
Set column after which characters are ignored in typical free-form
lines in the source file. The default value is 132.
\&\fIn\fR may be \fBnone\fR, meaning that the entire line is meaningful.
\&\fB\-ffree\-line\-length\-0\fR means the same thing as
\&\fB\-ffree\-line\-length\-none\fR.
.IP "\fB\-fmax\-identifier\-length=\fR\fIn\fR" 4
.IX Item "-fmax-identifier-length=n"
Specify the maximum allowed identifier length. Typical values are
31 (Fortran 95) and 63 (Fortran 2003 and Fortran 2008).
.IP "\fB\-fimplicit\-none\fR" 4
.IX Item "-fimplicit-none"
Specify that no implicit typing is allowed, unless overridden by explicit
\&\f(CW\*(C`IMPLICIT\*(C'\fR statements. This is the equivalent of adding
\&\f(CW\*(C`implicit none\*(C'\fR to the start of every procedure.
.IP "\fB\-fcray\-pointer\fR" 4
.IX Item "-fcray-pointer"
Enable the Cray pointer extension, which provides C\-like pointer
functionality.
.IP "\fB\-fopenmp\fR" 4
.IX Item "-fopenmp"
Enable the OpenMP extensions. This includes OpenMP \f(CW\*(C`!$omp\*(C'\fR directives
in free form
and \f(CW\*(C`c$omp\*(C'\fR, \f(CW*$omp\fR and \f(CW\*(C`!$omp\*(C'\fR directives in fixed form,
\&\f(CW\*(C`!$\*(C'\fR conditional compilation sentinels in free form
and \f(CW\*(C`c$\*(C'\fR, \f(CW\*(C`*$\*(C'\fR and \f(CW\*(C`!$\*(C'\fR sentinels in fixed form,
and when linking arranges for the OpenMP runtime library to be linked
in. The option \fB\-fopenmp\fR implies \fB\-frecursive\fR.
.IP "\fB\-fno\-range\-check\fR" 4
.IX Item "-fno-range-check"
Disable range checking on results of simplification of constant
expressions during compilation. For example, \s-1GNU\s0 Fortran will give
an error at compile time when simplifying \f(CW\*(C`a = 1. / 0\*(C'\fR.
With this option, no error will be given and \f(CW\*(C`a\*(C'\fR will be assigned
the value \f(CW\*(C`+Infinity\*(C'\fR. If an expression evaluates to a value
outside of the relevant range of [\f(CW\*(C`\-HUGE()\*(C'\fR:\f(CW\*(C`HUGE()\*(C'\fR],
then the expression will be replaced by \f(CW\*(C`\-Inf\*(C'\fR or \f(CW\*(C`+Inf\*(C'\fR
as appropriate.
Similarly, \f(CW\*(C`DATA i/Z\*(AqFFFFFFFF\*(Aq/\*(C'\fR will result in an integer overflow
on most systems, but with \fB\-fno\-range\-check\fR the value will
\&\*(L"wrap around\*(R" and \f(CW\*(C`i\*(C'\fR will be initialized to \-1 instead.
.IP "\fB\-std=\fR\fIstd\fR" 4
.IX Item "-std=std"
Specify the standard to which the program is expected to conform, which
may be one of \fBf95\fR, \fBf2003\fR, \fBf2008\fR, \fBgnu\fR, or
\&\fBlegacy\fR. The default value for \fIstd\fR is \fBgnu\fR, which
specifies a superset of the Fortran 95 standard that includes all of the
extensions supported by \s-1GNU\s0 Fortran, although warnings will be given for
obsolete extensions not recommended for use in new code. The
\&\fBlegacy\fR value is equivalent but without the warnings for obsolete
extensions, and may be useful for old non-standard programs. The
\&\fBf95\fR, \fBf2003\fR and \fBf2008\fR values specify strict
conformance to the Fortran 95, Fortran 2003 and Fortran 2008 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 standards.
.Sh "Enable and customize preprocessing"
.IX Subsection "Enable and customize preprocessing"
Preprocessor related options. See section
\&\fBPreprocessing and conditional compilation\fR for more detailed
information on preprocessing in \fBgfortran\fR.
.IP "\fB\-cpp\fR" 4
.IX Item "-cpp"
.PD 0
.IP "\fB\-nocpp\fR" 4
.IX Item "-nocpp"
.PD
Enable preprocessing. The preprocessor is automatically invoked if
the file extension is \fI.fpp\fR, \fI.FPP\fR, \fI.F\fR, \fI.FOR\fR,
\&\fI.FTN\fR, \fI.F90\fR, \fI.F95\fR, \fI.F03\fR or \fI.F08\fR. Use
this option to manually enable preprocessing of any kind of Fortran file.
.Sp
To disable preprocessing of files with any of the above listed extensions,
use the negative form: \fB\-nocpp\fR.
.Sp
The preprocessor is run in traditional mode, be aware that any
restrictions of the file-format, e.g. fixed-form line width,
apply for preprocessed output as well.
.IP "\fB\-dM\fR" 4
.IX Item "-dM"
Instead of the normal output, generate a list of \f(CW\*(Aq#define\*(Aq\fR
directives for all the macros defined during the execution of the
preprocessor, including predefined macros. This gives you a way
of finding out what is predefined in your version of the preprocessor.
Assuming you have no file \fIfoo.f90\fR, the command
.Sp
.Vb 1
\& touch foo.f90; gfortran \-cpp \-dM foo.f90
.Ve
.Sp
will show all the predefined macros.
.IP "\fB\-dD\fR" 4
.IX Item "-dD"
Like \fB\-dM\fR except in two respects: it does not include the
predefined macros, and it outputs both the \f(CW\*(C`#define\*(C'\fR directives
and the result of preprocessing. Both kinds of output go to the
standard output file.
.IP "\fB\-dN\fR" 4
.IX Item "-dN"
Like \fB\-dD\fR, but emit only the macro names, not their expansions.
.IP "\fB\-dU\fR" 4
.IX Item "-dU"
Like \fBdD\fR except that only macros that are expanded, or whose
definedness is tested in preprocessor directives, are output; the
output is delayed until the use or test of the macro; and \f(CW\*(Aq#undef\*(Aq\fR
directives are also output for macros tested but undefined at the time.
.IP "\fB\-dI\fR" 4
.IX Item "-dI"
Output \f(CW\*(Aq#include\*(Aq\fR directives in addition to the result
of preprocessing.
.IP "\fB\-fworking\-directory\fR" 4
.IX Item "-fworking-directory"
Enable generation of linemarkers in the preprocessor output that will
let the compiler know the current working directory at the time of
preprocessing. When this option is enabled, the preprocessor will emit,
after the initial linemarker, a second linemarker with the current
working directory followed by two slashes. \s-1GCC\s0 will use this directory,
when it's present in the preprocessed input, as the directory emitted
as the current working directory in some debugging information formats.
This option is implicitly enabled if debugging information is enabled,
but this can be inhibited with the negated form
\&\fB\-fno\-working\-directory\fR. If the \fB\-P\fR flag is present
in the command line, this option has no effect, since no \f(CW\*(C`#line\*(C'\fR
directives are emitted whatsoever.
.IP "\fB\-idirafter\fR \fIdir\fR" 4
.IX Item "-idirafter dir"
Search \fIdir\fR for include files, but do it after all directories
specified with \fB\-I\fR and the standard system directories have
been exhausted. \fIdir\fR is treated as a system include directory.
If dir begins with \f(CW\*(C`=\*(C'\fR, then the \f(CW\*(C`=\*(C'\fR will be replaced by
the sysroot prefix; see \fB\-\-sysroot\fR and \fB\-isysroot\fR.
.IP "\fB\-imultilib\fR \fIdir\fR" 4
.IX Item "-imultilib dir"
Use \fIdir\fR as a subdirectory of the directory containing target-specific
\&\*(C+ headers.
.IP "\fB\-iprefix\fR \fIprefix\fR" 4
.IX Item "-iprefix prefix"
Specify \fIprefix\fR as the prefix for subsequent \fB\-iwithprefix\fR
options. If the \fIprefix\fR represents a directory, you should include
the final \f(CW\*(Aq/\*(Aq\fR.
.IP "\fB\-isysroot\fR \fIdir\fR" 4
.IX Item "-isysroot dir"
This option is like the \fB\-\-sysroot\fR option, but applies only to
header files. See the \fB\-\-sysroot\fR option for more information.
.IP "\fB\-iquote\fR \fIdir\fR" 4
.IX Item "-iquote dir"
Search \fIdir\fR only for header files requested with \f(CW\*(C`#include "file"\*(C'\fR;
they are not searched for \f(CW\*(C`#include <file>\*(C'\fR, before all directories
specified by \fB\-I\fR and before the standard system directories. If
\&\fIdir\fR begins with \f(CW\*(C`=\*(C'\fR, then the \f(CW\*(C`=\*(C'\fR will be replaced by the
sysroot prefix; see \fB\-\-sysroot\fR and \fB\-isysroot\fR.
.IP "\fB\-isystem\fR \fIdir\fR" 4
.IX Item "-isystem dir"
Search \fIdir\fR for header files, after all directories specified by
\&\fB\-I\fR but before the standard system directories. Mark it as a
system directory, so that it gets the same special treatment as is
applied to the standard system directories. If \fIdir\fR begins with
\&\f(CW\*(C`=\*(C'\fR, then the \f(CW\*(C`=\*(C'\fR will be replaced by the sysroot prefix;
see \fB\-\-sysroot\fR and \fB\-isysroot\fR.
.IP "\fB\-nostdinc\fR" 4
.IX Item "-nostdinc"
Do not search the standard system directories for header files. Only
the directories you have specified with \fB\-I\fR options (and the
directory of the current file, if appropriate) are searched.
.IP "\fB\-undef\fR" 4
.IX Item "-undef"
Do not predefine any system-specific or GCC-specific macros.
The standard predefined macros remain defined.
.IP "\fB\-A\fR\fIpredicate\fR\fB=\fR\fIanswer\fR" 4
.IX Item "-Apredicate=answer"
Make an assertion with the predicate \fIpredicate\fR and answer \fIanswer\fR.
This form is preferred to the older form \-A predicate(answer), which is still
supported, because it does not use shell special characters.
.IP "\fB\-A\-\fR\fIpredicate\fR\fB=\fR\fIanswer\fR" 4
.IX Item "-A-predicate=answer"
Cancel an assertion with the predicate \fIpredicate\fR and answer \fIanswer\fR.
.IP "\fB\-C\fR" 4
.IX Item "-C"
Do not discard comments. All comments are passed through to the output
file, except for comments in processed directives, which are deleted
along with the directive.
.Sp
You should be prepared for side effects when using \fB\-C\fR; it causes
the preprocessor to treat comments as tokens in their own right. For example,
comments appearing at the start of what would be a directive line have the
effect of turning that line into an ordinary source line, since the first
token on the line is no longer a \f(CW\*(Aq#\*(Aq\fR.
.Sp
Warning: this currently handles C\-Style comments only. The preprocessor
does not yet recognize Fortran-style comments.
.IP "\fB\-CC\fR" 4
.IX Item "-CC"
Do not discard comments, including during macro expansion. This is like
\&\fB\-C\fR, except that comments contained within macros are also passed
through to the output file where the macro is expanded.
.Sp
In addition to the side-effects of the \fB\-C\fR option, the \fB\-CC\fR
option causes all \*(C+\-style comments inside a macro to be converted to C\-style
comments. This is to prevent later use of that macro from inadvertently
commenting out the remainder of the source line. The \fB\-CC\fR option
is generally used to support lint comments.
.Sp
Warning: this currently handles C\- and \*(C+\-Style comments only. The
preprocessor does not yet recognize Fortran-style comments.
.IP "\fB\-D\fR\fIname\fR" 4
.IX Item "-Dname"
Predefine name as a macro, with definition \f(CW1\fR.
.IP "\fB\-D\fR\fIname\fR\fB=\fR\fIdefinition\fR" 4
.IX Item "-Dname=definition"
The contents of \fIdefinition\fR are tokenized and processed as if they
appeared during translation phase three in a \f(CW\*(Aq#define\*(Aq\fR directive.
In particular, the definition will be truncated by embedded newline
characters.
.Sp
If you are invoking the preprocessor from a shell or shell-like program
you may need to use the shell's quoting syntax to protect characters such
as spaces that have a meaning in the shell syntax.
.Sp
If you wish to define a function-like macro on the command line, write
its argument list with surrounding parentheses before the equals sign
(if any). Parentheses are meaningful to most shells, so you will need
to quote the option. With sh and csh, \f(CW\*(C`\-D\*(Aqname(args...)=definition\*(Aq\*(C'\fR
works.
.Sp
\&\fB\-D\fR and \fB\-U\fR options are processed in the order they are
given on the command line. All \-imacros file and \-include file options
are processed after all \-D and \-U options.
.IP "\fB\-H\fR" 4
.IX Item "-H"
Print the name of each header file used, in addition to other normal
activities. Each name is indented to show how deep in the \f(CW\*(Aq#include\*(Aq\fR
stack it is.
.IP "\fB\-P\fR" 4
.IX Item "-P"
Inhibit generation of linemarkers in the output from the preprocessor.
This might be useful when running the preprocessor on something that
is not C code, and will be sent to a program which might be confused
by the linemarkers.
.IP "\fB\-U\fR\fIname\fR" 4
.IX Item "-Uname"
Cancel any previous definition of \fIname\fR, either built in or provided
with a \fB\-D\fR option.
.Sh "Options to request or suppress errors and warnings"
.IX Subsection "Options to request or suppress errors and warnings"
Errors are diagnostic messages that report that the \s-1GNU\s0 Fortran compiler
cannot compile the relevant piece of source code. The compiler will
continue to process the program in an attempt to report further errors
to aid in debugging, but will not produce any compiled output.
.PP
Warnings are diagnostic messages that report constructions which
are not inherently erroneous but which are risky or suggest there is
likely to be a bug in the program. Unless \fB\-Werror\fR is specified,
they do not prevent compilation of the program.
.PP
You can request many specific warnings with options beginning \fB\-W\fR,
for example \fB\-Wimplicit\fR to request warnings on implicit
declarations. Each of these specific warning options also has a
negative form beginning \fB\-Wno\-\fR to turn off warnings;
for example, \fB\-Wno\-implicit\fR. This manual lists only one of the
two forms, whichever is not the default.
.PP
These options control the amount and kinds of errors and warnings produced
by \s-1GNU\s0 Fortran:
.IP "\fB\-fmax\-errors=\fR\fIn\fR" 4
.IX Item "-fmax-errors=n"
Limits the maximum number of error messages to \fIn\fR, at which point
\&\s-1GNU\s0 Fortran bails out rather than attempting to continue processing the
source code. If \fIn\fR is 0, there is no limit on the number of error
messages produced.
.IP "\fB\-fsyntax\-only\fR" 4
.IX Item "-fsyntax-only"
Check the code for syntax errors, but don't actually compile it. This
will generate module files for each module present in the code, but no
other output file.
.IP "\fB\-pedantic\fR" 4
.IX Item "-pedantic"
Issue warnings for uses of extensions to Fortran 95.
\&\fB\-pedantic\fR also applies to C\-language constructs where they
occur in \s-1GNU\s0 Fortran source files, such as use of \fB\ee\fR in a
character constant within a directive like \f(CW\*(C`#include\*(C'\fR.
.Sp
Valid Fortran 95 programs should compile properly with or without
this option.
However, without this option, certain \s-1GNU\s0 extensions and traditional
Fortran features are supported as well.
With this option, many of them are rejected.
.Sp
Some users try to use \fB\-pedantic\fR to check programs for conformance.
They soon find that it does not do quite what they want\-\-\-it finds some
nonstandard practices, but not all.
However, improvements to \s-1GNU\s0 Fortran in this area are welcome.
.Sp
This should be used in conjunction with \fB\-std=f95\fR,
\&\fB\-std=f2003\fR or \fB\-std=f2008\fR.
.IP "\fB\-pedantic\-errors\fR" 4
.IX Item "-pedantic-errors"
Like \fB\-pedantic\fR, except that errors are produced rather than
warnings.
.IP "\fB\-Wall\fR" 4
.IX Item "-Wall"
Enables commonly used warning options pertaining to usage that
we recommend avoiding and that we believe are easy to avoid.
This currently includes \fB\-Waliasing\fR,
\&\fB\-Wampersand\fR, \fB\-Wsurprising\fR, \fB\-Wintrinsics\-std\fR,
\&\fB\-Wno\-tabs\fR, \fB\-Wintrinsic\-shadow\fR and \fB\-Wline\-truncation\fR.
.IP "\fB\-Waliasing\fR" 4
.IX Item "-Waliasing"
Warn about possible aliasing of dummy arguments. Specifically, it warns
if the same actual argument is associated with a dummy argument with
\&\f(CW\*(C`INTENT(IN)\*(C'\fR and a dummy argument with \f(CW\*(C`INTENT(OUT)\*(C'\fR in a call
with an explicit interface.
.Sp
The following example will trigger the warning.
.Sp
.Vb 7
\& interface
\& subroutine bar(a,b)
\& integer, intent(in) :: a
\& integer, intent(out) :: b
\& end subroutine
\& end interface
\& integer :: a
\&
\& call bar(a,a)
.Ve
.IP "\fB\-Wampersand\fR" 4
.IX Item "-Wampersand"
Warn about missing ampersand in continued character constants. The warning is
given with \fB\-Wampersand\fR, \fB\-pedantic\fR, \fB\-std=f95\fR,
\&\fB\-std=f2003\fR and \fB\-std=f2008\fR. Note: With no ampersand
given in a continued character constant, \s-1GNU\s0 Fortran assumes continuation
at the first non-comment, non-whitespace character after the ampersand
that initiated the continuation.
.IP "\fB\-Warray\-temporaries\fR" 4
.IX Item "-Warray-temporaries"
Warn about array temporaries generated by the compiler. The information
generated by this warning is sometimes useful in optimization, in order to
avoid such temporaries.
.IP "\fB\-Wcharacter\-truncation\fR" 4
.IX Item "-Wcharacter-truncation"
Warn when a character assignment will truncate the assigned string.
.IP "\fB\-Wline\-truncation\fR" 4
.IX Item "-Wline-truncation"
Warn when a source code line will be truncated.
.IP "\fB\-Wconversion\fR" 4
.IX Item "-Wconversion"
Warn about implicit conversions between different types.
.IP "\fB\-Wimplicit\-interface\fR" 4
.IX Item "-Wimplicit-interface"
Warn if a procedure is called without an explicit interface.
Note this only checks that an explicit interface is present. It does not
check that the declared interfaces are consistent across program units.
.IP "\fB\-Wimplicit\-procedure\fR" 4
.IX Item "-Wimplicit-procedure"
Warn if a procedure is called that has neither an explicit interface
nor has been declared as \f(CW\*(C`EXTERNAL\*(C'\fR.
.IP "\fB\-Wintrinsics\-std\fR" 4
.IX Item "-Wintrinsics-std"
Warn if \fBgfortran\fR finds a procedure named like an intrinsic not
available in the currently selected standard (with \fB\-std\fR) and treats
it as \f(CW\*(C`EXTERNAL\*(C'\fR procedure because of this. \fB\-fall\-intrinsics\fR can
be used to never trigger this behavior and always link to the intrinsic
regardless of the selected standard.
.IP "\fB\-Wsurprising\fR" 4
.IX Item "-Wsurprising"
Produce a warning when \*(L"suspicious\*(R" code constructs are encountered.
While technically legal these usually indicate that an error has been made.
.Sp
This currently produces a warning under the following circumstances:
.RS 4
.IP "\(bu" 4
An \s-1INTEGER\s0 \s-1SELECT\s0 construct has a \s-1CASE\s0 that can never be matched as its
lower value is greater than its upper value.
.IP "\(bu" 4
A \s-1LOGICAL\s0 \s-1SELECT\s0 construct has three \s-1CASE\s0 statements.
.IP "\(bu" 4
A \s-1TRANSFER\s0 specifies a source that is shorter than the destination.
.IP "\(bu" 4
The type of a function result is declared more than once with the same type. If
\&\fB\-pedantic\fR or standard-conforming mode is enabled, this is an error.
.IP "\(bu" 4
A \f(CW\*(C`CHARACTER\*(C'\fR variable is declared with negative length.
.RE
.RS 4
.RE
.IP "\fB\-Wtabs\fR" 4
.IX Item "-Wtabs"
By default, tabs are accepted as whitespace, but tabs are not members
of the Fortran Character Set. For continuation lines, a tab followed
by a digit between 1 and 9 is supported. \fB\-Wno\-tabs\fR will cause
a warning to be issued if a tab is encountered. Note, \fB\-Wno\-tabs\fR
is active for \fB\-pedantic\fR, \fB\-std=f95\fR, \fB\-std=f2003\fR,
\&\fB\-std=f2008\fR and \fB\-Wall\fR.
.IP "\fB\-Wunderflow\fR" 4
.IX Item "-Wunderflow"
Produce a warning when numerical constant expressions are
encountered, which yield an \s-1UNDERFLOW\s0 during compilation.
.IP "\fB\-Wintrinsic\-shadow\fR" 4
.IX Item "-Wintrinsic-shadow"
Warn if a user-defined procedure or module procedure has the same name as an
intrinsic; in this case, an explicit interface or \f(CW\*(C`EXTERNAL\*(C'\fR or
\&\f(CW\*(C`INTRINSIC\*(C'\fR declaration might be needed to get calls later resolved to
the desired intrinsic/procedure.
.IP "\fB\-Wunused\-parameter\fR" 4
.IX Item "-Wunused-parameter"
Contrary to \fBgcc\fR's meaning of \fB\-Wunused\-parameter\fR,
\&\fBgfortran\fR's implementation of this option does not warn
about unused dummy arguments, but about unused \f(CW\*(C`PARAMETER\*(C'\fR values.
\&\fB\-Wunused\-parameter\fR is not included in \fB\-Wall\fR but is
implied by \fB\-Wall \-Wextra\fR.
.IP "\fB\-Walign\-commons\fR" 4
.IX Item "-Walign-commons"
By default, \fBgfortran\fR warns about any occasion of variables being
padded for proper alignment inside a \s-1COMMON\s0 block. This warning can be turned
off via \fB\-Wno\-align\-commons\fR. See also \fB\-falign\-commons\fR.
.IP "\fB\-Werror\fR" 4
.IX Item "-Werror"
Turns all warnings into errors.
.PP
Some of these have no effect when compiling programs written in Fortran.
.Sh "Options for debugging your program or \s-1GNU\s0 Fortran"
.IX Subsection "Options for debugging your program or GNU Fortran"
\&\s-1GNU\s0 Fortran has various special options that are used for debugging
either your program or the \s-1GNU\s0 Fortran compiler.
.IP "\fB\-fdump\-parse\-tree\fR" 4
.IX Item "-fdump-parse-tree"
Output the internal parse tree before starting code generation. Only
really useful for debugging the \s-1GNU\s0 Fortran compiler itself.
.IP "\fB\-ffpe\-trap=\fR\fIlist\fR" 4
.IX Item "-ffpe-trap=list"
Specify a list of \s-1IEEE\s0 exceptions when a Floating Point Exception
(\s-1FPE\s0) should be raised. On most systems, this will result in a \s-1SIGFPE\s0
signal being sent and the program being interrupted, producing a core
file useful for debugging. \fIlist\fR is a (possibly empty) comma-separated
list of the following \s-1IEEE\s0 exceptions: \fBinvalid\fR (invalid floating
point operation, such as \f(CW\*(C`SQRT(\-1.0)\*(C'\fR), \fBzero\fR (division by
zero), \fBoverflow\fR (overflow in a floating point operation),
\&\fBunderflow\fR (underflow in a floating point operation),
\&\fBprecision\fR (loss of precision during operation) and \fBdenormal\fR
(operation produced a denormal value).
.Sp
Some of the routines in the Fortran runtime library, like
\&\fB\s-1CPU_TIME\s0\fR, are likely to trigger floating point exceptions when
\&\f(CW\*(C`ffpe\-trap=precision\*(C'\fR is used. For this reason, the use of
\&\f(CW\*(C`ffpe\-trap=precision\*(C'\fR is not recommended.
.IP "\fB\-fbacktrace\fR" 4
.IX Item "-fbacktrace"
Specify that, when a runtime error is encountered or a deadly signal is
emitted (segmentation fault, illegal instruction, bus error or
floating-point exception), the Fortran runtime
library should output a backtrace of the error. This option
only has influence for compilation of the Fortran main program.
.IP "\fB\-fdump\-core\fR" 4
.IX Item "-fdump-core"
Request that a core-dump file is written to disk when a runtime error
is encountered on systems that support core dumps. This option is
only effective for the compilation of the Fortran main program.
.Sh "Options for directory search"
.IX Subsection "Options for directory search"
These options affect how \s-1GNU\s0 Fortran searches
for files specified by the \f(CW\*(C`INCLUDE\*(C'\fR directive and where it searches
for previously compiled modules.
.PP
It also affects the search paths used by \fBcpp\fR when used to preprocess
Fortran source.
.IP "\fB\-I\fR\fIdir\fR" 4
.IX Item "-Idir"
These affect interpretation of the \f(CW\*(C`INCLUDE\*(C'\fR directive
(as well as of the \f(CW\*(C`#include\*(C'\fR directive of the \fBcpp\fR
preprocessor).
.Sp
Also note that the general behavior of \fB\-I\fR and
\&\f(CW\*(C`INCLUDE\*(C'\fR is pretty much the same as of \fB\-I\fR with
\&\f(CW\*(C`#include\*(C'\fR in the \fBcpp\fR preprocessor, with regard to
looking for \fIheader.gcc\fR files and other such things.
.Sp
This path is also used to search for \fI.mod\fR files when previously
compiled modules are required by a \f(CW\*(C`USE\*(C'\fR statement.
.IP "\fB\-J\fR\fIdir\fR" 4
.IX Item "-Jdir"
.PD 0
.IP "\fB\-M\fR\fIdir\fR" 4
.IX Item "-Mdir"
.PD
This option specifies where to put \fI.mod\fR files for compiled modules.
It is also added to the list of directories to searched by an \f(CW\*(C`USE\*(C'\fR
statement.
.Sp
The default is the current directory.
.Sp
\&\fB\-M\fR is deprecated to avoid conflicts with existing \s-1GCC\s0 options.
.IP "\fB\-fintrinsic\-modules\-path\fR \fIdir\fR" 4
.IX Item "-fintrinsic-modules-path dir"
This option specifies the location of pre-compiled intrinsic modules, if
they are not in the default location expected by the compiler.
.Sh "Influencing the linking step"
.IX Subsection "Influencing the linking step"
These options come into play when the compiler links object files into an
executable output file. They are meaningless if the compiler is not doing
a link step.
.IP "\fB\-static\-libgfortran\fR" 4
.IX Item "-static-libgfortran"
On systems that provide \fIlibgfortran\fR as a shared and a static
library, this option forces the use of the static version. If no
shared version of \fIlibgfortran\fR was built when the compiler was
configured, this option has no effect.
.Sh "Influencing runtime behavior"
.IX Subsection "Influencing runtime behavior"
These options affect the runtime behavior of programs compiled with \s-1GNU\s0 Fortran.
.IP "\fB\-fconvert=\fR\fIconversion\fR" 4
.IX Item "-fconvert=conversion"
Specify the representation of data for unformatted files. Valid
values for conversion are: \fBnative\fR, the default; \fBswap\fR,
swap between big\- and little-endian; \fBbig-endian\fR, use big-endian
representation for unformatted files; \fBlittle-endian\fR, use little-endian
representation for unformatted files.
.Sp
\&\fIThis option has an effect only when used in the main program.
The \f(CI\*(C`CONVERT\*(C'\fI specifier and the \s-1GFORTRAN_CONVERT_UNIT\s0 environment
variable override the default specified by \f(BI\-fconvert\fI.\fR
.IP "\fB\-fno\-range\-check\fR" 4
.IX Item "-fno-range-check"
Disable range checking of input values during integer \f(CW\*(C`READ\*(C'\fR operations.
For example, \s-1GNU\s0 Fortran will give an error if an input value is
outside of the relevant range of [\f(CW\*(C`\-HUGE()\*(C'\fR:\f(CW\*(C`HUGE()\*(C'\fR]. In other words,
with \f(CW\*(C`INTEGER (kind=4) :: i\*(C'\fR , attempting to read \-2147483648 will
give an error unless \fB\-fno\-range\-check\fR is given.
.IP "\fB\-frecord\-marker=\fR\fIlength\fR" 4
.IX Item "-frecord-marker=length"
Specify the length of record markers for unformatted files.
Valid values for \fIlength\fR are 4 and 8. Default is 4.
\&\fIThis is different from previous versions of\fR \fBgfortran\fR,
which specified a default record marker length of 8 on most
systems. If you want to read or write files compatible
with earlier versions of \fBgfortran\fR, use \fB\-frecord\-marker=8\fR.
.IP "\fB\-fmax\-subrecord\-length=\fR\fIlength\fR" 4
.IX Item "-fmax-subrecord-length=length"
Specify the maximum length for a subrecord. The maximum permitted
value for length is 2147483639, which is also the default. Only
really useful for use by the gfortran testsuite.
.IP "\fB\-fsign\-zero\fR" 4
.IX Item "-fsign-zero"
When enabled, floating point numbers of value zero with the sign bit set
are written as negative number in formatted output and treated as
negative in the \f(CW\*(C`SIGN\*(C'\fR intrinsic. \f(CW\*(C`fno\-sign\-zero\*(C'\fR does not
print the negative sign of zero values and regards zero as positive
number in the \f(CW\*(C`SIGN\*(C'\fR intrinsic for compatibility with F77.
Default behavior is to show the negative sign.
.Sh "Options for code generation conventions"
.IX Subsection "Options for code generation conventions"
These machine-independent options control the interface conventions
used in code generation.
.PP
Most of them have both positive and negative forms; the negative form
of \fB\-ffoo\fR would be \fB\-fno\-foo\fR. In the table below, only
one of the forms is listed\-\-\-the one which is not the default. You
can figure out the other form by either removing \fBno\-\fR or adding
it.
.IP "\fB\-fno\-automatic\fR" 4
.IX Item "-fno-automatic"
Treat each program unit (except those marked as \s-1RECURSIVE\s0) as if the
\&\f(CW\*(C`SAVE\*(C'\fR statement were specified for every local variable and array
referenced in it. Does not affect common blocks. (Some Fortran compilers
provide this option under the name \fB\-static\fR or \fB\-save\fR.)
The default, which is \fB\-fautomatic\fR, uses the stack for local
variables smaller than the value given by \fB\-fmax\-stack\-var\-size\fR.
Use the option \fB\-frecursive\fR to use no static memory.
.IP "\fB\-ff2c\fR" 4
.IX Item "-ff2c"
Generate code designed to be compatible with code generated
by \fBg77\fR and \fBf2c\fR.
.Sp
The calling conventions used by \fBg77\fR (originally implemented
in \fBf2c\fR) require functions that return type
default \f(CW\*(C`REAL\*(C'\fR to actually return the C type \f(CW\*(C`double\*(C'\fR, and
functions that return type \f(CW\*(C`COMPLEX\*(C'\fR to return the values via an
extra argument in the calling sequence that points to where to
store the return value. Under the default \s-1GNU\s0 calling conventions, such
functions simply return their results as they would in \s-1GNU\s0
C\-\-\-default \f(CW\*(C`REAL\*(C'\fR functions return the C type \f(CW\*(C`float\*(C'\fR, and
\&\f(CW\*(C`COMPLEX\*(C'\fR functions return the \s-1GNU\s0 C type \f(CW\*(C`complex\*(C'\fR.
Additionally, this option implies the \fB\-fsecond\-underscore\fR
option, unless \fB\-fno\-second\-underscore\fR is explicitly requested.
.Sp
This does not affect the generation of code that interfaces with
the \fBlibgfortran\fR library.
.Sp
\&\fICaution:\fR It is not a good idea to mix Fortran code compiled with
\&\fB\-ff2c\fR with code compiled with the default \fB\-fno\-f2c\fR
calling conventions as, calling \f(CW\*(C`COMPLEX\*(C'\fR or default \f(CW\*(C`REAL\*(C'\fR
functions between program parts which were compiled with different
calling conventions will break at execution time.
.Sp
\&\fICaution:\fR This will break code which passes intrinsic functions
of type default \f(CW\*(C`REAL\*(C'\fR or \f(CW\*(C`COMPLEX\*(C'\fR as actual arguments, as
the library implementations use the \fB\-fno\-f2c\fR calling conventions.
.IP "\fB\-fno\-underscoring\fR" 4
.IX Item "-fno-underscoring"
Do not transform names of entities specified in the Fortran
source file by appending underscores to them.
.Sp
With \fB\-funderscoring\fR in effect, \s-1GNU\s0 Fortran appends one
underscore to external names with no underscores. This is done to ensure
compatibility with code produced by many \s-1UNIX\s0 Fortran compilers.
.Sp
\&\fICaution\fR: The default behavior of \s-1GNU\s0 Fortran is
incompatible with \fBf2c\fR and \fBg77\fR, please use the
\&\fB\-ff2c\fR option if you want object files compiled with
\&\s-1GNU\s0 Fortran to be compatible with object code created with these
tools.
.Sp
Use of \fB\-fno\-underscoring\fR is not recommended unless you are
experimenting with issues such as integration of \s-1GNU\s0 Fortran into
existing system environments (vis\-@`{a}\-vis existing libraries, tools,
and so on).
.Sp
For example, with \fB\-funderscoring\fR, and assuming other defaults like
\&\fB\-fcase\-lower\fR and that \f(CW\*(C`j()\*(C'\fR and \f(CW\*(C`max_count()\*(C'\fR are
external functions while \f(CW\*(C`my_var\*(C'\fR and \f(CW\*(C`lvar\*(C'\fR are local variables,
a statement like
.Sp
.Vb 1
\& I = J() + MAX_COUNT (MY_VAR, LVAR)
.Ve
.Sp
is implemented as something akin to:
.Sp
.Vb 1
\& i = j_() + max_count_\|_(&my_var_\|_, &lvar);
.Ve
.Sp
With \fB\-fno\-underscoring\fR, the same statement is implemented as:
.Sp
.Vb 1
\& i = j() + max_count(&my_var, &lvar);
.Ve
.Sp
Use of \fB\-fno\-underscoring\fR allows direct specification of
user-defined names while debugging and when interfacing \s-1GNU\s0 Fortran
code with other languages.
.Sp
Note that just because the names match does \fInot\fR mean that the
interface implemented by \s-1GNU\s0 Fortran for an external name matches the
interface implemented by some other language for that same name.
That is, getting code produced by \s-1GNU\s0 Fortran to link to code produced
by some other compiler using this or any other method can be only a
small part of the overall solution\-\-\-getting the code generated by
both compilers to agree on issues other than naming can require
significant effort, and, unlike naming disagreements, linkers normally
cannot detect disagreements in these other areas.
.Sp
Also, note that with \fB\-fno\-underscoring\fR, the lack of appended
underscores introduces the very real possibility that a user-defined
external name will conflict with a name in a system library, which
could make finding unresolved-reference bugs quite difficult in some
cases\-\-\-they might occur at program run time, and show up only as
buggy behavior at run time.
.Sp
In future versions of \s-1GNU\s0 Fortran we hope to improve naming and linking
issues so that debugging always involves using the names as they appear
in the source, even if the names as seen by the linker are mangled to
prevent accidental linking between procedures with incompatible
interfaces.
.IP "\fB\-fwhole\-file\fR" 4
.IX Item "-fwhole-file"
By default, \s-1GNU\s0 Fortran parses, resolves and translates each procedure
in a file separately. Using this option modifies this such that the
whole file is parsed and placed in a single front-end tree. During
resolution, in addition to all the usual checks and fixups, references
to external procedures that are in the same file effect resolution of
that procedure, if not already done, and a check of the interfaces. The
dependences are resolved by changing the order in which the file is
translated into the backend tree. Thus, a procedure that is referenced
is translated before the reference and the duplication of backend tree
declarations eliminated.
.IP "\fB\-fsecond\-underscore\fR" 4
.IX Item "-fsecond-underscore"
By default, \s-1GNU\s0 Fortran appends an underscore to external
names. If this option is used \s-1GNU\s0 Fortran appends two
underscores to names with underscores and one underscore to external names
with no underscores. \s-1GNU\s0 Fortran also appends two underscores to
internal names with underscores to avoid naming collisions with external
names.
.Sp
This option has no effect if \fB\-fno\-underscoring\fR is
in effect. It is implied by the \fB\-ff2c\fR option.
.Sp
Otherwise, with this option, an external name such as \f(CW\*(C`MAX_COUNT\*(C'\fR
is implemented as a reference to the link-time external symbol
\&\f(CW\*(C`max_count_\|_\*(C'\fR, instead of \f(CW\*(C`max_count_\*(C'\fR. This is required
for compatibility with \fBg77\fR and \fBf2c\fR, and is implied
by use of the \fB\-ff2c\fR option.
.IP "\fB\-fcheck=\fR\fI<keyword>\fR" 4
.IX Item "-fcheck=<keyword>"
Enable the generation of run-time checks; the argument shall be
a comma-delimited list of the following keywords.
.RS 4
.IP "\fBall\fR" 4
.IX Item "all"
Enable all run-time test of \fB\-fcheck\fR.
.IP "\fBarray-temps\fR" 4
.IX Item "array-temps"
Warns at run time when for passing an actual argument a temporary array
had to be generated. The information generated by this warning is
sometimes useful in optimization, in order to avoid such temporaries.
.Sp
Note: The warning is only printed once per location.
.IP "\fBbounds\fR" 4
.IX Item "bounds"
Enable generation of run-time checks for array subscripts
and against the declared minimum and maximum values. It also
checks array indices for assumed and deferred
shape arrays against the actual allocated bounds and ensures that all string
lengths are equal for character array constructors without an explicit
typespec.
.Sp
Some checks require that \fB\-fcheck=bounds\fR is set for
the compilation of the main program.
.Sp
Note: In the future this may also include other forms of checking, e.g.,
checking substring references.
.IP "\fBdo\fR" 4
.IX Item "do"
Enable generation of run-time checks for invalid modification of loop
iteration variables.
.IP "\fBmem\fR" 4
.IX Item "mem"
Enable generation of run-time checks for memory allocation.
Note: This option does not affect explicit allocations using the
\&\f(CW\*(C`ALLOCATE\*(C'\fR statement, which will be always checked.
.IP "\fBpointer\fR" 4
.IX Item "pointer"
Enable generation of run-time checks for pointers and allocatables.
.IP "\fBrecursion\fR" 4
.IX Item "recursion"
Enable generation of run-time checks for recursively called subroutines and
functions which are not marked as recursive. See also \fB\-frecursive\fR.
Note: This check does not work for OpenMP programs and is disabled if used
together with \fB\-frecursive\fR and \fB\-fopenmp\fR.
.RE
.RS 4
.RE
.IP "\fB\-fbounds\-check\fR" 4
.IX Item "-fbounds-check"
Deprecated alias for \fB\-fcheck=bounds\fR.
.IP "\fB\-fcheck\-array\-temporaries\fR" 4
.IX Item "-fcheck-array-temporaries"
Deprecated alias for \fB\-fcheck=array\-temps\fR.
.IP "\fB\-fmax\-array\-constructor=\fR\fIn\fR" 4
.IX Item "-fmax-array-constructor=n"
This option can be used to increase the upper limit permitted in
array constructors. The code below requires this option to expand
the array at compile time.
.Sp
.Vb 7
\& C<program test>
\& C<implicit none>
\& C<integer j>
\& C<integer, parameter :: n = 100000>
\& C<integer, parameter :: i(n) = (/ (2*j, j = 1, n) /)>
\& C<print \*(Aq(10(I0,1X))\*(Aq, i>
\& C<end program test>
.Ve
.Sp
\&\fICaution: This option can lead to long compile times and excessively
large object files.\fR
.Sp
The default value for \fIn\fR is 65535.
.IP "\fB\-fmax\-stack\-var\-size=\fR\fIn\fR" 4
.IX Item "-fmax-stack-var-size=n"
This option specifies the size in bytes of the largest array that will be put
on the stack; if the size is exceeded static memory is used (except in
procedures marked as \s-1RECURSIVE\s0). Use the option \fB\-frecursive\fR to
allow for recursive procedures which do not have a \s-1RECURSIVE\s0 attribute or
for parallel programs. Use \fB\-fno\-automatic\fR to never use the stack.
.Sp
This option currently only affects local arrays declared with constant
bounds, and may not apply to all character variables.
Future versions of \s-1GNU\s0 Fortran may improve this behavior.
.Sp
The default value for \fIn\fR is 32768.
.IP "\fB\-fpack\-derived\fR" 4
.IX Item "-fpack-derived"
This option tells \s-1GNU\s0 Fortran to pack derived type members as closely as
possible. Code compiled with this option is likely to be incompatible
with code compiled without this option, and may execute slower.
.IP "\fB\-frepack\-arrays\fR" 4
.IX Item "-frepack-arrays"
In some circumstances \s-1GNU\s0 Fortran may pass assumed shape array
sections via a descriptor describing a noncontiguous area of memory.
This option adds code to the function prologue to repack the data into
a contiguous block at runtime.
.Sp
This should result in faster accesses to the array. However it can introduce
significant overhead to the function call, especially when the passed data
is noncontiguous.
.IP "\fB\-fshort\-enums\fR" 4
.IX Item "-fshort-enums"
This option is provided for interoperability with C code that was
compiled with the \fB\-fshort\-enums\fR option. It will make
\&\s-1GNU\s0 Fortran choose the smallest \f(CW\*(C`INTEGER\*(C'\fR kind a given
enumerator set will fit in, and give all its enumerators this kind.
.IP "\fB\-fexternal\-blas\fR" 4
.IX Item "-fexternal-blas"
This option will make \fBgfortran\fR generate calls to \s-1BLAS\s0 functions
for some matrix operations like \f(CW\*(C`MATMUL\*(C'\fR, instead of using our own
algorithms, if the size of the matrices involved is larger than a given
limit (see \fB\-fblas\-matmul\-limit\fR). This may be profitable if an
optimized vendor \s-1BLAS\s0 library is available. The \s-1BLAS\s0 library will have
to be specified at link time.
.IP "\fB\-fblas\-matmul\-limit=\fR\fIn\fR" 4
.IX Item "-fblas-matmul-limit=n"
Only significant when \fB\-fexternal\-blas\fR is in effect.
Matrix multiplication of matrices with size larger than (or equal to) \fIn\fR
will be performed by calls to \s-1BLAS\s0 functions, while others will be
handled by \fBgfortran\fR internal algorithms. If the matrices
involved are not square, the size comparison is performed using the
geometric mean of the dimensions of the argument and result matrices.
.Sp
The default value for \fIn\fR is 30.
.IP "\fB\-frecursive\fR" 4
.IX Item "-frecursive"
Allow indirect recursion by forcing all local arrays to be allocated
on the stack. This flag cannot be used together with
\&\fB\-fmax\-stack\-var\-size=\fR or \fB\-fno\-automatic\fR.
.IP "\fB\-finit\-local\-zero\fR" 4
.IX Item "-finit-local-zero"
.PD 0
.IP "\fB\-finit\-integer=\fR\fIn\fR" 4
.IX Item "-finit-integer=n"
.IP "\fB\-finit\-real=\fR\fI<zero|inf|\-inf|nan|snan>\fR\fB \fR" 4
.IX Item "-finit-real=<zero|inf|-inf|nan|snan> "
.IP "\fB\-finit\-logical=\fR\fI<true|false>\fR" 4
.IX Item "-finit-logical=<true|false>"
.IP "\fB\-finit\-character=\fR\fIn\fR" 4
.IX Item "-finit-character=n"
.PD
The \fB\-finit\-local\-zero\fR option instructs the compiler to
initialize local \f(CW\*(C`INTEGER\*(C'\fR, \f(CW\*(C`REAL\*(C'\fR, and \f(CW\*(C`COMPLEX\*(C'\fR
variables to zero, \f(CW\*(C`LOGICAL\*(C'\fR variables to false, and
\&\f(CW\*(C`CHARACTER\*(C'\fR variables to a string of null bytes. Finer-grained
initialization options are provided by the
\&\fB\-finit\-integer=\fR\fIn\fR,
\&\fB\-finit\-real=\fR\fI<zero|inf|\-inf|nan|snan>\fR (which also initializes
the real and imaginary parts of local \f(CW\*(C`COMPLEX\*(C'\fR variables),
\&\fB\-finit\-logical=\fR\fI<true|false>\fR, and
\&\fB\-finit\-character=\fR\fIn\fR (where \fIn\fR is an \s-1ASCII\s0 character
value) options. These options do not initialize components of derived
type variables, nor do they initialize variables that appear in an
\&\f(CW\*(C`EQUIVALENCE\*(C'\fR statement. (This limitation may be removed in
future releases).
.Sp
Note that the \fB\-finit\-real=nan\fR option initializes \f(CW\*(C`REAL\*(C'\fR
and \f(CW\*(C`COMPLEX\*(C'\fR variables with a quiet NaN. For a signalling NaN
use \fB\-finit\-real=snan\fR; note, however, that compile-time
optimizations may convert them into quiet NaN and that trapping
needs to be enabled (e.g. via \fB\-ffpe\-trap\fR).
.IP "\fB\-falign\-commons\fR" 4
.IX Item "-falign-commons"
By default, \fBgfortran\fR enforces proper alignment of all variables in a
\&\s-1COMMON\s0 block by padding them as needed. On certain platforms this is mandatory,
on others it increases performance. If a \s-1COMMON\s0 block is not declared with
consistent data types everywhere, this padding can cause trouble, and
\&\fB\-fno\-align\-commons\fR can be used to disable automatic alignment. The
same form of this option should be used for all files that share a \s-1COMMON\s0 block.
To avoid potential alignment issues in \s-1COMMON\s0 blocks, it is recommended to order
objects from largests to smallest.
.IP "\fB\-fno\-protect\-parens\fR" 4
.IX Item "-fno-protect-parens"
By default the parentheses in expression are honored for all optimization
levels such that the compiler does not do any re-association. Using
\&\fB\-fno\-protect\-parens\fR allows the compiler to reorder \s-1REAL\s0 and
\&\s-1COMPLEX\s0 expressions to produce faster code. Note that for the re-association
optimization \fB\-fno\-signed\-zeros\fR and \fB\-fno\-trapping\-math\fR
need to be in effect.
.SH "ENVIRONMENT"
.IX Header "ENVIRONMENT"
The \fBgfortran\fR compiler currently does not make use of any environment
variables to control its operation above and beyond those
that affect the operation of \fBgcc\fR.
.SH "BUGS"
.IX Header "BUGS"
For instructions on reporting bugs, see
<\fBhttp://gcc.gnu.org/bugs.html\fR>.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fIgpl\fR\|(7), \fIgfdl\fR\|(7), \fIfsf\-funding\fR\|(7),
\&\fIcpp\fR\|(1), \fIgcov\fR\|(1), \fIgcc\fR\|(1), \fIas\fR\|(1), \fIld\fR\|(1), \fIgdb\fR\|(1), \fIadb\fR\|(1), \fIdbx\fR\|(1), \fIsdb\fR\|(1)
and the Info entries for \fIgcc\fR, \fIcpp\fR, \fIgfortran\fR, \fIas\fR,
\&\fIld\fR, \fIbinutils\fR and \fIgdb\fR.
.SH "AUTHOR"
.IX Header "AUTHOR"
See the Info entry for \fBgfortran\fR for contributors to \s-1GCC\s0 and
\&\s-1GNU\s0 Fortran.
.SH "COPYRIGHT"
.IX Header "COPYRIGHT"
Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
.PP
Permission is granted to copy, distribute and/or modify this document
under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with the
Invariant Sections being \*(L"Funding Free Software\*(R", the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below). A copy of the license is included in the \fIgfdl\fR\|(7) man page.
.PP
(a) The \s-1FSF\s0's Front-Cover Text is:
.PP
.Vb 1
\& A GNU Manual
.Ve
.PP
(b) The \s-1FSF\s0's Back-Cover Text is:
.PP
.Vb 3
\& You have freedom to copy and modify this GNU Manual, like GNU
\& software. Copies published by the Free Software Foundation raise
\& funds for GNU development.
.Ve