.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .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" '' . ds C` . ds C' '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 >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" .\" 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 "2023-05-08" "gcc-12.3.0" "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 \-fallow\-argument\-mismatch \-fallow\-invalid\-boz \&\-fbackslash \-fcray\-pointer \-fd\-lines\-as\-code \-fd\-lines\-as\-comments \&\-fdec \-fdec\-char\-conversions \-fdec\-structure \-fdec\-intrinsic\-ints \&\-fdec\-static \-fdec\-math \-fdec\-include \-fdec\-format\-defaults \&\-fdec\-blank\-format\-item \-fdefault\-double\-8 \-fdefault\-integer\-8 \&\-fdefault\-real\-8 \-fdefault\-real\-10 \-fdefault\-real\-16 \-fdollar\-ok \&\-ffixed\-line\-length\-\fR\fIn\fR \fB\-ffixed\-line\-length\-none \-fpad\-source \&\-ffree\-form \-ffree\-line\-length\-\fR\fIn\fR \fB\-ffree\-line\-length\-none \&\-fimplicit\-none \-finteger\-4\-integer\-8 \-fmax\-identifier\-length \&\-fmodule\-private \-ffixed\-form \-fno\-range\-check \-fopenacc \-fopenmp \&\-freal\-4\-real\-10 \-freal\-4\-real\-16 \-freal\-4\-real\-8 \-freal\-8\-real\-10 \&\-freal\-8\-real\-16 \-freal\-8\-real\-4 \-std=\fR\fIstd\fR \fB\-ftest\-forall\-temp\fR .IP "\fIPreprocessing Options\fR" 4 .IX Item "Preprocessing Options" \&\fB\-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\-H \-P \&\-U\fR\fImacro\fR \fB\-cpp \-dD \-dI \-dM \-dN \-dU \-fworking\-directory \&\-imultilib\fR \fIdir\fR \&\fB\-iprefix\fR \fIfile\fR \fB\-iquote \-isysroot\fR \fIdir\fR \fB\-isystem\fR \fIdir\fR \fB\-nocpp \&\-nostdinc \&\-undef\fR .IP "\fIError and Warning Options\fR" 4 .IX Item "Error and Warning Options" \&\fB\-Waliasing \-Wall \-Wampersand \-Warray\-bounds \&\-Wc\-binding\-type \-Wcharacter\-truncation \-Wconversion \&\-Wdo\-subscript \-Wfunction\-elimination \-Wimplicit\-interface \&\-Wimplicit\-procedure \-Wintrinsic\-shadow \-Wuse\-without\-only \&\-Wintrinsics\-std \-Wline\-truncation \-Wno\-align\-commons \&\-Wno\-overwrite\-recursive \-Wno\-tabs \-Wreal\-q\-constant \-Wsurprising \&\-Wunderflow \-Wunused\-parameter \-Wrealloc\-lhs \-Wrealloc\-lhs\-all \&\-Wfrontend\-loop\-interchange \-Wtarget\-lifetime \-fmax\-errors=\fR\fIn\fR \&\fB\-fsyntax\-only \-pedantic \&\-pedantic\-errors\fR .IP "\fIDebugging Options\fR" 4 .IX Item "Debugging Options" \&\fB\-fbacktrace \-fdump\-fortran\-optimized \-fdump\-fortran\-original \&\-fdebug\-aux\-vars \-fdump\-fortran\-global \-fdump\-parse\-tree \-ffpe\-trap=\fR\fIlist\fR \&\fB\-ffpe\-summary=\fR\fIlist\fR\fB \fR .IP "\fIDirectory Options\fR" 4 .IX Item "Directory Options" \&\fB\-I\fR\fIdir\fR \fB\-J\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\-fmax\-subrecord\-length=\fR\fIlength\fR \&\fB\-frecord\-marker=\fR\fIlength\fR \fB\-fsign\-zero\fR .IP "\fIInteroperability Options\fR" 4 .IX Item "Interoperability Options" \&\fB\-fc\-prototypes \-fc\-prototypes\-external\fR .IP "\fICode Generation Options\fR" 4 .IX Item "Code Generation Options" \&\fB\-faggressive\-function\-elimination \-fblas\-matmul\-limit=\fR\fIn\fR \&\fB\-fbounds\-check \-ftail\-call\-workaround \-ftail\-call\-workaround=\fR\fIn\fR \&\fB\-fcheck\-array\-temporaries \&\-fcheck=\fR\fI\fR \&\fB\-fcoarray=\fR\fI\fR \fB\-fexternal\-blas \-ff2c \&\-ffrontend\-loop\-interchange \-ffrontend\-optimize \&\-finit\-character=\fR\fIn\fR \fB\-finit\-integer=\fR\fIn\fR \fB\-finit\-local\-zero \&\-finit\-derived \-finit\-logical=\fR\fI\fR \&\fB\-finit\-real=\fR\fI\fR \&\fB\-finline\-matmul\-limit=\fR\fIn\fR \&\fB\-finline\-arg\-packing \-fmax\-array\-constructor=\fR\fIn\fR \&\fB\-fmax\-stack\-var\-size=\fR\fIn\fR \fB\-fno\-align\-commons \-fno\-automatic \&\-fno\-protect\-parens \-fno\-underscoring \-fsecond\-underscore \&\-fpack\-derived \-frealloc\-lhs \-frecursive \-frepack\-arrays \&\-fshort\-enums \-fstack\-arrays\fR .SS "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=\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\-fallow\-argument\-mismatch\fR" 4 .IX Item "-fallow-argument-mismatch" Some code contains calls to external procedures with mismatches between the calls and the procedure definition, or with mismatches between different calls. Such code is non-conforming, and will usually be flagged with an error. This options degrades the error to a warning, which can only be disabled by disabling all warnings via \&\fB\-w\fR. Only a single occurrence per argument is flagged by this warning. \fB\-fallow\-argument\-mismatch\fR is implied by \&\fB\-std=legacy\fR. .Sp Using this option is \fIstrongly\fR discouraged. It is possible to provide standard-conforming code which allows different types of arguments by using an explicit interface and \f(CWTYPE(*)\fR. .IP "\fB\-fallow\-invalid\-boz\fR" 4 .IX Item "-fallow-invalid-boz" A \s-1BOZ\s0 literal constant can occur in a limited number of contexts in standard conforming Fortran. This option degrades an error condition to a warning, and allows a \s-1BOZ\s0 literal constant to appear where the Fortran standard would otherwise prohibit its use. .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\-fdec\fR" 4 .IX Item "-fdec" \&\s-1DEC\s0 compatibility mode. Enables extensions and other features that mimic the default behavior of older compilers (such as \s-1DEC\s0). These features are non-standard and should be avoided at all costs. For details on \s-1GNU\s0 Fortran's implementation of these extensions see the full documentation. .Sp Other flags enabled by this switch are: \&\fB\-fdollar\-ok\fR \fB\-fcray\-pointer\fR \fB\-fdec\-char\-conversions\fR \&\fB\-fdec\-structure\fR \fB\-fdec\-intrinsic\-ints\fR \fB\-fdec\-static\fR \&\fB\-fdec\-math\fR \fB\-fdec\-include\fR \fB\-fdec\-blank\-format\-item\fR \&\fB\-fdec\-format\-defaults\fR .Sp If \fB\-fd\-lines\-as\-code\fR/\fB\-fd\-lines\-as\-comments\fR are unset, then \&\fB\-fdec\fR also sets \fB\-fd\-lines\-as\-comments\fR. .IP "\fB\-fdec\-char\-conversions\fR" 4 .IX Item "-fdec-char-conversions" Enable the use of character literals in assignments and \f(CW\*(C`DATA\*(C'\fR statements for non-character variables. .IP "\fB\-fdec\-structure\fR" 4 .IX Item "-fdec-structure" Enable \s-1DEC\s0 \f(CW\*(C`STRUCTURE\*(C'\fR and \f(CW\*(C`RECORD\*(C'\fR as well as \f(CW\*(C`UNION\*(C'\fR, \&\f(CW\*(C`MAP\*(C'\fR, 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. .IP "\fB\-fdec\-intrinsic\-ints\fR" 4 .IX Item "-fdec-intrinsic-ints" Enable B/I/J/K kind variants of existing integer functions (e.g. \s-1BIAND, IIAND, JIAND,\s0 etc...). For a complete list of intrinsics see the full documentation. .IP "\fB\-fdec\-math\fR" 4 .IX Item "-fdec-math" Enable legacy math intrinsics such as \s-1COTAN\s0 and degree-valued trigonometric functions (e.g. \s-1TAND, ATAND,\s0 etc...) for compatability with older code. .IP "\fB\-fdec\-static\fR" 4 .IX Item "-fdec-static" Enable DEC-style \s-1STATIC\s0 and \s-1AUTOMATIC\s0 attributes to explicitly specify the storage of variables and other objects. .IP "\fB\-fdec\-include\fR" 4 .IX Item "-fdec-include" Enable parsing of \s-1INCLUDE\s0 as a statement in addition to parsing it as \&\s-1INCLUDE\s0 line. When parsed as \s-1INCLUDE\s0 statement, \s-1INCLUDE\s0 does not have to be on a single line and can use line continuations. .IP "\fB\-fdec\-format\-defaults\fR" 4 .IX Item "-fdec-format-defaults" Enable format specifiers F, G and I to be used without width specifiers, default widths will be used instead. .IP "\fB\-fdec\-blank\-format\-item\fR" 4 .IX Item "-fdec-blank-format-item" Enable a blank format item at the end of a format specification i.e. nothing following the final comma. .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, unless \f(CW\*(C`\-fno\-pad\-source\*(C'\fR, 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\-fno\-pad\-source\fR" 4 .IX Item "-fno-pad-source" By default fixed-form lines have spaces assumed (as if padded to that length) after the ends of short fixed-form lines. This is not done either if \&\fB\-ffixed\-line\-length\-0\fR, \fB\-ffixed\-line\-length\-none\fR or if \fB\-fno\-pad\-source\fR option is used. With any of those options continued character constants never have implicit spaces appended to them to fill out the line. .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 later). .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\-fopenacc\fR" 4 .IX Item "-fopenacc" Enable the OpenACC extensions. This includes OpenACC \f(CW\*(C`!$acc\*(C'\fR directives in free form and \f(CW\*(C`c$acc\*(C'\fR, \f(CW*$acc\fR and \&\f(CW\*(C`!$acc\*(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 OpenACC runtime library to be linked in. .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\-fdefault\-integer\-8\fR" 4 .IX Item "-fdefault-integer-8" Set the default integer and logical types to an 8 byte wide type. This option also affects the kind of integer constants like \f(CW42\fR. Unlike \&\fB\-finteger\-4\-integer\-8\fR, it does not promote variables with explicit kind declaration. .IP "\fB\-fdefault\-real\-8\fR" 4 .IX Item "-fdefault-real-8" Set the default real type to an 8 byte wide type. This option also affects the kind of non-double real constants like \f(CW1.0\fR. This option promotes the default width of \f(CW\*(C`DOUBLE PRECISION\*(C'\fR and double real constants like \f(CW\*(C`1.d0\*(C'\fR to 16 bytes if possible. If \f(CW\*(C`\-fdefault\-double\-8\*(C'\fR is given along with \f(CW\*(C`fdefault\-real\-8\*(C'\fR, \f(CW\*(C`DOUBLE PRECISION\*(C'\fR and double real constants are not promoted. Unlike \fB\-freal\-4\-real\-8\fR, \&\f(CW\*(C`fdefault\-real\-8\*(C'\fR does not promote variables with explicit kind declarations. .IP "\fB\-fdefault\-real\-10\fR" 4 .IX Item "-fdefault-real-10" Set the default real type to an 10 byte wide type. This option also affects the kind of non-double real constants like \f(CW1.0\fR. This option promotes the default width of \f(CW\*(C`DOUBLE PRECISION\*(C'\fR and double real constants like \f(CW\*(C`1.d0\*(C'\fR to 16 bytes if possible. If \f(CW\*(C`\-fdefault\-double\-8\*(C'\fR is given along with \f(CW\*(C`fdefault\-real\-10\*(C'\fR, \f(CW\*(C`DOUBLE PRECISION\*(C'\fR and double real constants are not promoted. Unlike \fB\-freal\-4\-real\-10\fR, \&\f(CW\*(C`fdefault\-real\-10\*(C'\fR does not promote variables with explicit kind declarations. .IP "\fB\-fdefault\-real\-16\fR" 4 .IX Item "-fdefault-real-16" Set the default real type to an 16 byte wide type. This option also affects the kind of non-double real constants like \f(CW1.0\fR. This option promotes the default width of \f(CW\*(C`DOUBLE PRECISION\*(C'\fR and double real constants like \f(CW\*(C`1.d0\*(C'\fR to 16 bytes if possible. If \f(CW\*(C`\-fdefault\-double\-8\*(C'\fR is given along with \f(CW\*(C`fdefault\-real\-16\*(C'\fR, \f(CW\*(C`DOUBLE PRECISION\*(C'\fR and double real constants are not promoted. Unlike \fB\-freal\-4\-real\-16\fR, \&\f(CW\*(C`fdefault\-real\-16\*(C'\fR does not promote variables with explicit kind declarations. .IP "\fB\-fdefault\-double\-8\fR" 4 .IX Item "-fdefault-double-8" Set the \f(CW\*(C`DOUBLE PRECISION\*(C'\fR type and double real constants like \f(CW\*(C`1.d0\*(C'\fR to an 8 byte wide type. Do nothing if this is already the default. This option prevents \fB\-fdefault\-real\-8\fR, \&\fB\-fdefault\-real\-10\fR, and \fB\-fdefault\-real\-16\fR, from promoting \f(CW\*(C`DOUBLE PRECISION\*(C'\fR and double real constants like \&\f(CW\*(C`1.d0\*(C'\fR to 16 bytes. .IP "\fB\-finteger\-4\-integer\-8\fR" 4 .IX Item "-finteger-4-integer-8" Promote all \f(CW\*(C`INTEGER(KIND=4)\*(C'\fR entities to an \f(CW\*(C`INTEGER(KIND=8)\*(C'\fR entities. If \f(CW\*(C`KIND=8\*(C'\fR 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 \f(CW\*(C`EQUIVALENCE\*(C'\fR and/or \f(CW\*(C`COMMON\*(C'\fR, generic interfaces, \&\s-1BOZ\s0 literal constant conversion, and I/O. Inspection of the intermediate representation of the translated Fortran code, produced by \&\fB\-fdump\-tree\-original\fR, is suggested. .IP "\fB\-freal\-4\-real\-8\fR" 4 .IX Item "-freal-4-real-8" .PD 0 .IP "\fB\-freal\-4\-real\-10\fR" 4 .IX Item "-freal-4-real-10" .IP "\fB\-freal\-4\-real\-16\fR" 4 .IX Item "-freal-4-real-16" .IP "\fB\-freal\-8\-real\-4\fR" 4 .IX Item "-freal-8-real-4" .IP "\fB\-freal\-8\-real\-10\fR" 4 .IX Item "-freal-8-real-10" .IP "\fB\-freal\-8\-real\-16\fR" 4 .IX Item "-freal-8-real-16" .PD Promote all \f(CW\*(C`REAL(KIND=M)\*(C'\fR entities to \f(CW\*(C`REAL(KIND=N)\*(C'\fR entities. If \f(CW\*(C`REAL(KIND=N)\*(C'\fR is unavailable, then an error will be issued. The \f(CW\*(C`\-freal\-4\-\*(C'\fR flags also affect the default real kind and the \&\f(CW\*(C`\-freal\-8\-\*(C'\fR 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, \f(CW\*(C`\-fdefault\-real\-8\*(C'\fR, \f(CW\*(C`\-fdefault\-real\-10\*(C'\fR, \&\f(CW\*(C`\-fdefault\-real\-10\*(C'\fR, and \f(CW\*(C`\-fdefault\-double\-8\*(C'\fR 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 \f(CW\*(C`REAL(KIND=KIND(1.0))\*(C'\fR 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 \f(CW\*(C`EQUIVALENCE\*(C'\fR and/or \f(CW\*(C`COMMON\*(C'\fR, generic interfaces, \&\s-1BOZ\s0 literal constant conversion, and I/O and calls to intrinsic procedures when passing a value to the \f(CW\*(C`kind=\*(C'\fR dummy argument. Inspection of the intermediate representation of the translated Fortran code, produced by \&\fB\-fdump\-fortran\-original\fR or \fB\-fdump\-tree\-original\fR, is suggested. .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, \&\fBf2018\fR, \fBgnu\fR, or \fBlegacy\fR. The default value for \&\fIstd\fR is \fBgnu\fR, which specifies a superset of the latest Fortran 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, \fBf2008\fR, and \fBf2018\fR values specify strict conformance to the Fortran 95, Fortran 2003, Fortran 2008 and Fortran 2018 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. The deprecated option \fB\-std=f2008ts\fR acts as an alias for \&\fB\-std=f2018\fR. It is only present for backwards compatibility with earlier gfortran versions and should not be used any more. .IP "\fB\-ftest\-forall\-temp\fR" 4 .IX Item "-ftest-forall-temp" Enhance test coverage by forcing most forall assignments to use temporary. .SS "Enable and customize preprocessing" .IX Subsection "Enable and customize preprocessing" Many Fortran compilers including \s-1GNU\s0 Fortran allow passing the source code through a C preprocessor (\s-1CPP\s0; sometimes also called the Fortran preprocessor, \&\s-1FPP\s0) to allow for conditional compilation. In the case of \s-1GNU\s0 Fortran, this is the \s-1GNU C\s0 Preprocessor in the traditional mode. On systems with case-preserving file names, the preprocessor is automatically invoked if the filename extension is \fI.F\fR, \fI.FOR\fR, \fI.FTN\fR, \fI.fpp\fR, \&\fI.FPP\fR, \fI.F90\fR, \fI.F95\fR, \fI.F03\fR or \fI.F08\fR. To manually invoke the preprocessor on any file, use \fB\-cpp\fR, to disable preprocessing on files where the preprocessor is run automatically, use \&\fB\-nocpp\fR. .PP If a preprocessed file includes another file with the Fortran \f(CW\*(C`INCLUDE\*(C'\fR statement, the included file is not preprocessed. To preprocess included files, use the equivalent preprocessor statement \f(CW\*(C`#include\*(C'\fR. .PP If \s-1GNU\s0 Fortran invokes the preprocessor, \f(CW\*(C`_\|_GFORTRAN_\|_\*(C'\fR is defined. The macros \f(CW\*(C`_\|_GNUC_\|_\*(C'\fR, \f(CW\*(C`_\|_GNUC_MINOR_\|_\*(C'\fR and \&\f(CW\*(C`_\|_GNUC_PATCHLEVEL_\|_\*(C'\fR can be used to determine the version of the compiler. See \fBTop,,Overview,cpp,The C Preprocessor\fR for details. .PP \&\s-1GNU\s0 Fortran supports a number of \f(CW\*(C`INTEGER\*(C'\fR and \f(CW\*(C`REAL\*(C'\fR kind types in additional to the kind types required by the Fortran standard. The availability of any given kind type is architecture dependent. The following pre-defined preprocessor macros can be used to conditionally include code for these additional kind types: \f(CW\*(C`_\|_GFC_INT_1_\|_\*(C'\fR, \&\f(CW\*(C`_\|_GFC_INT_2_\|_\*(C'\fR, \f(CW\*(C`_\|_GFC_INT_8_\|_\*(C'\fR, \f(CW\*(C`_\|_GFC_INT_16_\|_\*(C'\fR, \&\f(CW\*(C`_\|_GFC_REAL_10_\|_\*(C'\fR, and \f(CW\*(C`_\|_GFC_REAL_16_\|_\*(C'\fR. .PP While \s-1CPP\s0 is the de-facto standard for preprocessing Fortran code, Part 3 of the Fortran 95 standard (\s-1ISO/IEC 1539\-3:1998\s0) defines Conditional Compilation, which is not widely used and not directly supported by the \s-1GNU\s0 Fortran compiler. You can use the program coco to preprocess such files (<\fBhttp://www.daniellnagle.com/coco.html\fR>). .PP The following options control preprocessing of Fortran code: .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. Any restrictions of the file-format, especially the limits on line length, apply for preprocessed output as well, so it might be advisable to use the \&\fB\-ffree\-line\-length\-none\fR or \fB\-ffixed\-line\-length\-none\fR options. .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 \-E \-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 is 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 \*(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. .SS "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 do not actually compile it. This will generate module files for each module present in the code, but no other output file. .IP "\fB\-Wpedantic\fR" 4 .IX Item "-Wpedantic" .PD 0 .IP "\fB\-pedantic\fR" 4 .IX Item "-pedantic" .PD Issue warnings for uses of extensions to Fortran. \&\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 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, \fB\-std=f2008\fR or \fB\-std=f2018\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\-Wconversion\fR, \fB\-Wsurprising\fR, \fB\-Wc\-binding\-type\fR, \&\fB\-Wintrinsics\-std\fR, \fB\-Wtabs\fR, \fB\-Wintrinsic\-shadow\fR, \&\fB\-Wline\-truncation\fR, \fB\-Wtarget\-lifetime\fR, \&\fB\-Winteger\-division\fR, \fB\-Wreal\-q\-constant\fR, \fB\-Wunused\fR and \fB\-Wundefined\-do\-loop\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, \fB\-std=f2008\fR and \&\fB\-std=f2018\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\-Wc\-binding\-type\fR" 4 .IX Item "-Wc-binding-type" Warn if the a variable might not be C interoperable. In particular, warn if the variable has been declared using an intrinsic type with default kind instead of using a kind parameter defined for C interoperability in the intrinsic \f(CW\*(C`ISO_C_Binding\*(C'\fR module. This option is implied by \&\fB\-Wall\fR. .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. This option is implied by \fB\-Wall\fR. For free-form source code, the default is \&\fB\-Werror=line\-truncation\fR such that truncations are reported as error. .IP "\fB\-Wconversion\fR" 4 .IX Item "-Wconversion" Warn about implicit conversions that are likely to change the value of the expression after conversion. Implied by \fB\-Wall\fR. .IP "\fB\-Wconversion\-extra\fR" 4 .IX Item "-Wconversion-extra" Warn about implicit conversions between different types and kinds. This option does \fInot\fR imply \fB\-Wconversion\fR. .IP "\fB\-Wextra\fR" 4 .IX Item "-Wextra" Enables some warning options for usages of language features which may be problematic. This currently includes \fB\-Wcompare\-reals\fR, \&\fB\-Wunused\-parameter\fR and \fB\-Wdo\-subscript\fR. .IP "\fB\-Wfrontend\-loop\-interchange\fR" 4 .IX Item "-Wfrontend-loop-interchange" Warn when using \fB\-ffrontend\-loop\-interchange\fR for performing loop interchanges. .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\-Winteger\-division\fR" 4 .IX Item "-Winteger-division" Warn if a constant integer division truncates its result. As an example, 3/5 evaluates to 0. .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\-Wno\-overwrite\-recursive\fR" 4 .IX Item "-Wno-overwrite-recursive" Do not warn when \fB\-fno\-automatic\fR is used with \fB\-frecursive\fR. Recursion will be broken if the relevant local variables do not have the attribute \&\f(CW\*(C`AUTOMATIC\*(C'\fR explicitly declared. This option can be used to suppress the warning when it is known that recursion is not broken. Useful for build environments that use \&\fB\-Werror\fR. .IP "\fB\-Wreal\-q\-constant\fR" 4 .IX Item "-Wreal-q-constant" Produce a warning if a real-literal-constant contains a \f(CW\*(C`q\*(C'\fR exponent-letter. .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 "*" 4 An \s-1INTEGER SELECT\s0 construct has a \s-1CASE\s0 that can never be matched as its lower value is greater than its upper value. .IP "*" 4 A \s-1LOGICAL SELECT\s0 construct has three \s-1CASE\s0 statements. .IP "*" 4 A \s-1TRANSFER\s0 specifies a source that is shorter than the destination. .IP "*" 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 "*" 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\-Wtabs\fR will cause a warning to be issued if a tab is encountered. Note, \fB\-Wtabs\fR is active for \fB\-pedantic\fR, \fB\-std=f95\fR, \fB\-std=f2003\fR, \&\fB\-std=f2008\fR, \fB\-std=f2018\fR and \&\fB\-Wall\fR. .IP "\fB\-Wundefined\-do\-loop\fR" 4 .IX Item "-Wundefined-do-loop" Warn if a \s-1DO\s0 loop with step either 1 or \-1 yields an underflow or an overflow during iteration of an induction variable of the loop. This option is implied by \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. Enabled by default. .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. This option is implied by \fB\-Wall\fR. .IP "\fB\-Wuse\-without\-only\fR" 4 .IX Item "-Wuse-without-only" Warn if a \f(CW\*(C`USE\*(C'\fR statement has no \f(CW\*(C`ONLY\*(C'\fR qualifier and thus implicitly imports all public entities of the used module. .IP "\fB\-Wunused\-dummy\-argument\fR" 4 .IX Item "-Wunused-dummy-argument" Warn about unused dummy arguments. This option is implied by \fB\-Wall\fR. .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 (see \fB\-Wunused\-dummy\-argument\fR), but about unused \f(CW\*(C`PARAMETER\*(C'\fR values. \fB\-Wunused\-parameter\fR is implied by \fB\-Wextra\fR if also \fB\-Wunused\fR or \&\fB\-Wall\fR is used. .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 \f(CW\*(C`COMMON\*(C'\fR block. This warning can be turned off via \fB\-Wno\-align\-commons\fR. See also \fB\-falign\-commons\fR. .IP "\fB\-Wfunction\-elimination\fR" 4 .IX Item "-Wfunction-elimination" Warn if any calls to impure functions are eliminated by the optimizations enabled by the \fB\-ffrontend\-optimize\fR option. This option is implied by \fB\-Wextra\fR. .IP "\fB\-Wrealloc\-lhs\fR" 4 .IX Item "-Wrealloc-lhs" Warn when the compiler might insert code to for allocation or reallocation of an allocatable array variable of intrinsic type in intrinsic assignments. In hot loops, the Fortran 2003 reallocation feature may reduce the performance. If the array is already allocated with the correct shape, consider using a whole-array array-spec (e.g. \f(CW\*(C`(:,:,:)\*(C'\fR) for the variable on the left-hand side to prevent the reallocation check. Note that in some cases the warning is shown, even if the compiler will optimize reallocation checks away. For instance, when the right-hand side contains the same variable multiplied by a scalar. See also \fB\-frealloc\-lhs\fR. .IP "\fB\-Wrealloc\-lhs\-all\fR" 4 .IX Item "-Wrealloc-lhs-all" Warn when the compiler inserts code to for allocation or reallocation of an allocatable variable; this includes scalars and derived types. .IP "\fB\-Wcompare\-reals\fR" 4 .IX Item "-Wcompare-reals" Warn when comparing real or complex types for equality or inequality. This option is implied by \fB\-Wextra\fR. .IP "\fB\-Wtarget\-lifetime\fR" 4 .IX Item "-Wtarget-lifetime" Warn if the pointer in a pointer assignment might be longer than the its target. This option is implied by \fB\-Wall\fR. .IP "\fB\-Wzerotrip\fR" 4 .IX Item "-Wzerotrip" Warn if a \f(CW\*(C`DO\*(C'\fR loop is known to execute zero times at compile time. This option is implied by \fB\-Wall\fR. .IP "\fB\-Wdo\-subscript\fR" 4 .IX Item "-Wdo-subscript" Warn if an array subscript inside a \s-1DO\s0 loop could lead to an out-of-bounds access even if the compiler cannot prove that the statement is actually executed, in cases like .Sp .Vb 6 \& real a(3) \& do i=1,4 \& if (condition(i)) then \& a(i) = 1.2 \& end if \& end do .Ve .Sp This option is implied by \fB\-Wextra\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. .SS "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\-fortran\-original\fR" 4 .IX Item "-fdump-fortran-original" Output the internal parse tree after translating the source program into internal representation. This option is mostly useful for debugging the \s-1GNU\s0 Fortran compiler itself. The output generated by this option might change between releases. This option may also generate internal compiler errors for features which have only recently been added. .IP "\fB\-fdump\-fortran\-optimized\fR" 4 .IX Item "-fdump-fortran-optimized" Output the parse tree after front-end optimization. Mostly useful for debugging the \s-1GNU\s0 Fortran compiler itself. The output generated by this option might change between releases. This option may also generate internal compiler errors for features which have only recently been added. .IP "\fB\-fdump\-parse\-tree\fR" 4 .IX Item "-fdump-parse-tree" Output the internal parse tree after translating the source program into internal representation. Mostly useful for debugging the \s-1GNU\s0 Fortran compiler itself. The output generated by this option might change between releases. This option may also generate internal compiler errors for features which have only recently been added. This option is deprecated; use \f(CW\*(C`\-fdump\-fortran\-original\*(C'\fR instead. .IP "\fB\-fdebug\-aux\-vars\fR" 4 .IX Item "-fdebug-aux-vars" Renames internal variables created by the gfortran front end and makes them accessible to a debugger. The name of the internal variables then start with upper-case letters followed by an underscore. This option is useful for debugging the compiler's code generation together with \&\f(CW\*(C`\-fdump\-tree\-original\*(C'\fR and enabling debugging of the executable program by using \f(CW\*(C`\-g\*(C'\fR or \f(CW\*(C`\-ggdb3\*(C'\fR. .IP "\fB\-fdump\-fortran\-global\fR" 4 .IX Item "-fdump-fortran-global" Output a list of the global identifiers after translating into middle-end representation. Mostly useful for debugging the \s-1GNU\s0 Fortran compiler itself. The output generated by this option might change between releases. This option may also generate internal compiler errors for features which have only recently been added. .IP "\fB\-ffpe\-trap=\fR\fIlist\fR" 4 .IX Item "-ffpe-trap=list" Specify a list of floating point exception traps to enable. On most systems, if a floating point exception occurs and the trap for that exception is enabled, a \s-1SIGFPE\s0 signal will be sent and the program being aborted, producing a core file useful for debugging. \fIlist\fR is a (possibly empty) comma-separated list of the following 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), \fBinexact\fR (loss of precision during operation), and \fBdenormal\fR (operation performed on a denormal value). The first five exceptions correspond to the five \&\s-1IEEE 754\s0 exceptions, whereas the last one (\fBdenormal\fR) is not part of the \s-1IEEE 754\s0 standard but is available on some common architectures such as x86. .Sp The first three exceptions (\fBinvalid\fR, \fBzero\fR, and \&\fBoverflow\fR) often indicate serious errors, and unless the program has provisions for dealing with these exceptions, enabling traps for these three exceptions is probably a good idea. .Sp If the option is used more than once in the command line, the lists will be joined: '\f(CW\*(C`ffpe\-trap=\*(C'\fR\fIlist1\fR \f(CW\*(C`ffpe\-trap=\*(C'\fR\fIlist2\fR' is equivalent to \f(CW\*(C`ffpe\-trap=\*(C'\fR\fIlist1\fR,\fIlist2\fR. .Sp Note that once enabled an exception cannot be disabled (no negative form). .Sp Many, if not most, floating point operations incur loss of precision due to rounding, and hence the \f(CW\*(C`ffpe\-trap=inexact\*(C'\fR is likely to be uninteresting in practice. .Sp By default no exception traps are enabled. .IP "\fB\-ffpe\-summary=\fR\fIlist\fR" 4 .IX Item "-ffpe-summary=list" Specify a list of floating-point exceptions, whose flag status is printed to \f(CW\*(C`ERROR_UNIT\*(C'\fR when invoking \f(CW\*(C`STOP\*(C'\fR and \f(CW\*(C`ERROR STOP\*(C'\fR. \&\fIlist\fR can be either \fBnone\fR, \fBall\fR or a comma-separated list of the following exceptions: \fBinvalid\fR, \fBzero\fR, \fBoverflow\fR, \&\fBunderflow\fR, \fBinexact\fR and \fBdenormal\fR. (See \&\fB\-ffpe\-trap\fR for a description of the exceptions.) .Sp If the option is used more than once in the command line, only the last one will be used. .Sp By default, a summary for all exceptions but \fBinexact\fR is shown. .IP "\fB\-fno\-backtrace\fR" 4 .IX Item "-fno-backtrace" When a serious runtime error is encountered or a deadly signal is emitted (segmentation fault, illegal instruction, bus error, floating-point exception, and the other \s-1POSIX\s0 signals that have the action \fBcore\fR), the Fortran runtime library tries to output a backtrace of the error. \f(CW\*(C`\-fno\-backtrace\*(C'\fR disables the backtrace generation. This option only has influence for compilation of the Fortran main program. .SS "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" 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. .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. .SS "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. .SS "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 on most systems 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 On \s-1POWER\s0 systems which suppport \fB\-mabi=ieeelongdouble\fR, there are additional options, which can be combined with others with commas. Those are .RS 4 .ie n .IP "@w<\fB\-fconvert=r16_ieee\fR Use \s-1IEEE\s0 128\-bit format for>" 4 .el .IP "\f(CW@w\fR<\fB\-fconvert=r16_ieee\fR Use \s-1IEEE\s0 128\-bit format for>" 4 .IX Item "@w<-fconvert=r16_ieee Use IEEE 128-bit format for>" \&\f(CW\*(C`REAL(KIND=16)\*(C'\fR. .ie n .IP "@w<\fB\-fconvert=r16_ibm\fR Use \s-1IBM\s0 long double format for>" 4 .el .IP "\f(CW@w\fR<\fB\-fconvert=r16_ibm\fR Use \s-1IBM\s0 long double format for>" 4 .IX Item "@w<-fconvert=r16_ibm Use IBM long double format for>" \&\f(CW\*(C`REAL(KIND=16)\*(C'\fR. .RE .RS 4 .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 .RE .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. \fB\-fno\-sign\-zero\fR does not print the negative sign of zero values (or values rounded to zero for I/O) and regards zero as positive number in the \f(CW\*(C`SIGN\*(C'\fR intrinsic for compatibility with Fortran 77. The default is \fB\-fsign\-zero\fR. .SS "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. .Sp Local variables or arrays having an explicit \f(CW\*(C`SAVE\*(C'\fR attribute are silently ignored unless the \fB\-pedantic\fR option is added. .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 C\s0 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 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\-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\-fcoarray=\fR\fI\fR" 4 .IX Item "-fcoarray=" .RS 4 .PD 0 .IP "\fBnone\fR" 4 .IX Item "none" .PD Disable coarray support; using coarray declarations and image-control statements will produce a compile-time error. (Default) .IP "\fBsingle\fR" 4 .IX Item "single" Single-image mode, i.e. \f(CW\*(C`num_images()\*(C'\fR is always one. .IP "\fBlib\fR" 4 .IX Item "lib" Library-based coarray parallelization; a suitable \s-1GNU\s0 Fortran coarray library needs to be linked. .RE .RS 4 .RE .IP "\fB\-fcheck=\fR\fI\fR" 4 .IX Item "-fcheck=" Enable the generation of run-time checks; the argument shall be a comma-delimited list of the following keywords. Prefixing a check with \&\fBno\-\fR disables it if it was activated by a previous specification. .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 "\fBbits\fR" 4 .IX Item "bits" Enable generation of run-time checks for invalid arguments to the bit manipulation intrinsics. .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 .Sp Example: Assuming you have a file \fIfoo.f90\fR, the command .Sp .Vb 1 \& gfortran \-fcheck=all,no\-array\-temps foo.f90 .Ve .Sp will compile the file with all checks enabled as specified above except warnings for generated array temporaries. .RE .IP "\fB\-fbounds\-check\fR" 4 .IX Item "-fbounds-check" Deprecated alias for \fB\-fcheck=bounds\fR. .IP "\fB\-ftail\-call\-workaround\fR" 4 .IX Item "-ftail-call-workaround" .PD 0 .IP "\fB\-ftail\-call\-workaround=\fR\fIn\fR" 4 .IX Item "-ftail-call-workaround=n" .PD Some C interfaces to Fortran codes violate the gfortran \s-1ABI\s0 by omitting the hidden character length arguments as described in This can lead to crashes because pushing arguments for tail calls can overflow the stack. .Sp To provide a workaround for existing binary packages, this option disables tail call optimization for gfortran procedures with character arguments. With \fB\-ftail\-call\-workaround=2\fR tail call optimization is disabled in all gfortran procedures with character arguments, with \fB\-ftail\-call\-workaround=1\fR or equivalent \&\fB\-ftail\-call\-workaround\fR only in gfortran procedures with character arguments that call implicitly prototyped procedures. .Sp Using this option can lead to problems including crashes due to insufficient stack space. .Sp It is \fIvery strongly\fR recommended to fix the code in question. The \fB\-fc\-prototypes\-external\fR option can be used to generate prototypes which conform to gfortran's \s-1ABI,\s0 for inclusion in the source code. .Sp Support for this option will likely be withdrawn in a future release of gfortran. .Sp The negative form, \fB\-fno\-tail\-call\-workaround\fR or equivalent \&\fB\-ftail\-call\-workaround=0\fR, can be used to disable this option. .Sp Default is currently \fB\-ftail\-call\-workaround\fR, this will change in future releases. .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 \& program test \& implicit none \& integer j \& integer, parameter :: n = 100000 \& integer, parameter :: i(n) = (/ (2*j, j = 1, n) /) \& print \*(Aq(10(I0,1X))\*(Aq, i \& 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 65536. .IP "\fB\-fstack\-arrays\fR" 4 .IX Item "-fstack-arrays" Adding this option will make the Fortran compiler put all arrays of unknown size and array temporaries onto stack memory. If your program uses very large local arrays it is possible that you will have to extend your runtime limits for stack memory on some operating systems. This flag is enabled by default at optimization level \fB\-Ofast\fR unless \&\fB\-fmax\-stack\-var\-size\fR is specified. .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\-finline\-arg\-packing\fR" 4 .IX Item "-finline-arg-packing" When passing an assumed-shape argument of a procedure as actual argument to an assumed-size or explicit size or as argument to a procedure that does not have an explicit interface, the argument may have to be packed, that is put into contiguous memory. An example is the call to \f(CW\*(C`foo\*(C'\fR in .Sp .Vb 7 \& subroutine foo(a) \& real, dimension(*) :: a \& end subroutine foo \& subroutine bar(b) \& real, dimension(:) :: b \& call foo(b) \& end subroutine bar .Ve .Sp When \fB\-finline\-arg\-packing\fR is in effect, this packing will be performed by inline code. This allows for more optimization while increasing code size. .Sp \&\fB\-finline\-arg\-packing\fR is implied by any of the \fB\-O\fR options except when optimizing for size via \fB\-Os\fR. If the code contains a very large number of argument that have to be packed, code size and also compilation time may become excessive. If that is the case, it may be better to disable this option. Instances of packing can be found by using \fB\-Warray\-temporaries\fR. .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\-finline\-matmul\-limit=\fR\fIn\fR" 4 .IX Item "-finline-matmul-limit=n" When front-end optimization is active, some calls to the \f(CW\*(C`MATMUL\*(C'\fR intrinsic function will be inlined. This may result in code size increase if the size of the matrix cannot be determined at compile time, as code for both cases is generated. Setting \&\f(CW\*(C`\-finline\-matmul\-limit=0\*(C'\fR will disable inlining in all cases. Setting this option with a value of \fIn\fR will produce inline code for matrices with size up to \fIn\fR. 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. The \f(CW\*(C`\-fblas\-matmul\-limit\*(C'\fR can be used to change this value. .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\-derived\fR" 4 .IX Item "-finit-derived" .IP "\fB\-finit\-integer=\fR\fIn\fR" 4 .IX Item "-finit-integer=n" .IP "\fB\-finit\-real=\fR\fI\fR" 4 .IX Item "-finit-real=" .IP "\fB\-finit\-logical=\fR\fI\fR" 4 .IX Item "-finit-logical=" .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\fR (which also initializes the real and imaginary parts of local \f(CW\*(C`COMPLEX\*(C'\fR variables), \&\fB\-finit\-logical=\fR\fI\fR, and \&\fB\-finit\-character=\fR\fIn\fR (where \fIn\fR is an \s-1ASCII\s0 character value) options. .Sp With \fB\-finit\-derived\fR, components of derived type variables will be initialized according to these flags. Components whose type is not covered by an explicit \fB\-finit\-*\fR flag will be treated as described above with \&\fB\-finit\-local\-zero\fR. .Sp These options do not initialize .RS 4 .IP "*" 4 objects with the \s-1POINTER\s0 attribute .IP "*" 4 allocatable arrays .IP "*" 4 variables that appear in an \f(CW\*(C`EQUIVALENCE\*(C'\fR statement. .RE .RS 4 .Sp (These limitations 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). .Sp The \fB\-finit\-integer\fR option will parse the value into an integer of type \f(CW\*(C`INTEGER(kind=C_LONG)\*(C'\fR on the host. Said value is then assigned to the integer variables in the Fortran code, which might result in wraparound if the value is too large for the kind. .Sp Finally, note that enabling any of the \fB\-finit\-*\fR options will silence warnings that would have been emitted by \fB\-Wuninitialized\fR for the affected local variables. .RE .IP "\fB\-falign\-commons\fR" 4 .IX Item "-falign-commons" By default, \fBgfortran\fR enforces proper alignment of all variables in a \&\f(CW\*(C`COMMON\*(C'\fR block by padding them as needed. On certain platforms this is mandatory, on others it increases performance. If a \f(CW\*(C`COMMON\*(C'\fR 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 \f(CW\*(C`COMMON\*(C'\fR block. To avoid potential alignment issues in \f(CW\*(C`COMMON\*(C'\fR blocks, it is recommended to order objects from largest 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 \f(CW\*(C`REAL\*(C'\fR and \&\f(CW\*(C`COMPLEX\*(C'\fR 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. The parentheses protection is enabled by default, unless \&\fB\-Ofast\fR is given. .IP "\fB\-frealloc\-lhs\fR" 4 .IX Item "-frealloc-lhs" An allocatable left-hand side of an intrinsic assignment is automatically (re)allocated if it is either unallocated or has a different shape. The option is enabled by default except when \fB\-std=f95\fR is given. See also \fB\-Wrealloc\-lhs\fR. .IP "\fB\-faggressive\-function\-elimination\fR" 4 .IX Item "-faggressive-function-elimination" Functions with identical argument lists are eliminated within statements, regardless of whether these functions are marked \&\f(CW\*(C`PURE\*(C'\fR or not. For example, in .Sp .Vb 1 \& a = f(b,c) + f(b,c) .Ve .Sp there will only be a single call to \f(CW\*(C`f\*(C'\fR. This option only works if \fB\-ffrontend\-optimize\fR is in effect. .IP "\fB\-ffrontend\-optimize\fR" 4 .IX Item "-ffrontend-optimize" This option performs front-end optimization, based on manipulating parts the Fortran parse tree. Enabled by default by any \fB\-O\fR option except \fB\-O0\fR and \fB\-Og\fR. Optimizations enabled by this option include: .RS 4 .ie n .IP "*" 4 .el .IP "*" 4 .IX Item "*" .PD 0 .IP "*" 4 .IX Item "*" .ie n .IP "*" 4 .el .IP "*" 4 .IX Item "*" .ie n .IP "*" 4 .el .IP "*" 4 .IX Item "*" .ie n .IP "*" 4 .el .IP "*" 4 .IX Item "*" .RE .RS 4 .PD .Sp It can be deselected by specifying \fB\-fno\-frontend\-optimize\fR. .RE .IP "\fB\-ffrontend\-loop\-interchange\fR" 4 .IX Item "-ffrontend-loop-interchange" Attempt to interchange loops in the Fortran front end where profitable. Enabled by default by any \fB\-O\fR option. At the moment, this option only affects \f(CW\*(C`FORALL\*(C'\fR and \&\f(CW\*(C`DO CONCURRENT\*(C'\fR statements with several forall triplets. .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 <\fBhttps://gcc.gnu.org/bugs/\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), \fIdbx\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\-2022 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.3 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