OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [doc/] [gfortran.1] - Blame information for rev 300

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 284 jeremybenn
.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05)
2
.\"
3
.\" Standard preamble:
4
.\" ========================================================================
5
.de Sh \" Subsection heading
6
.br
7
.if t .Sp
8
.ne 5
9
.PP
10
\fB\\$1\fR
11
.PP
12
..
13
.de Sp \" Vertical space (when we can't use .PP)
14
.if t .sp .5v
15
.if n .sp
16
..
17
.de Vb \" Begin verbatim text
18
.ft CW
19
.nf
20
.ne \\$1
21
..
22
.de Ve \" End verbatim text
23
.ft R
24
.fi
25
..
26
.\" Set up some character translations and predefined strings.  \*(-- will
27
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28
.\" double quote, and \*(R" will give a right double quote.  \*(C+ will
29
.\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
30
.\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
31
.\" nothing in troff, for use with C<>.
32
.tr \(*W-
33
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
34
.ie n \{\
35
.    ds -- \(*W-
36
.    ds PI pi
37
.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38
.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
39
.    ds L" ""
40
.    ds R" ""
41
.    ds C` ""
42
.    ds C' ""
43
'br\}
44
.el\{\
45
.    ds -- \|\(em\|
46
.    ds PI \(*p
47
.    ds L" ``
48
.    ds R" ''
49
'br\}
50
.\"
51
.\" Escape single quotes in literal strings from groff's Unicode transform.
52
.ie \n(.g .ds Aq \(aq
53
.el       .ds Aq '
54
.\"
55
.\" If the F register is turned on, we'll generate index entries on stderr for
56
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
57
.\" entries marked with X<> in POD.  Of course, you'll have to process the
58
.\" output yourself in some meaningful fashion.
59
.ie \nF \{\
60
.    de IX
61
.    tm Index:\\$1\t\\n%\t"\\$2"
62
..
63
.    nr % 0
64
.    rr F
65
.\}
66
.el \{\
67
.    de IX
68
..
69
.\}
70
.\"
71
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
72
.\" Fear.  Run.  Save yourself.  No user-serviceable parts.
73
.    \" fudge factors for nroff and troff
74
.if n \{\
75
.    ds #H 0
76
.    ds #V .8m
77
.    ds #F .3m
78
.    ds #[ \f1
79
.    ds #] \fP
80
.\}
81
.if t \{\
82
.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
83
.    ds #V .6m
84
.    ds #F 0
85
.    ds #[ \&
86
.    ds #] \&
87
.\}
88
.    \" simple accents for nroff and troff
89
.if n \{\
90
.    ds ' \&
91
.    ds ` \&
92
.    ds ^ \&
93
.    ds , \&
94
.    ds ~ ~
95
.    ds /
96
.\}
97
.if t \{\
98
.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
99
.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
100
.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
101
.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
102
.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
103
.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
104
.\}
105
.    \" troff and (daisy-wheel) nroff accents
106
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
107
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
108
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
109
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
110
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
111
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
112
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
113
.ds ae a\h'-(\w'a'u*4/10)'e
114
.ds Ae A\h'-(\w'A'u*4/10)'E
115
.    \" corrections for vroff
116
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
117
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
118
.    \" for low resolution devices (crt and lpr)
119
.if \n(.H>23 .if \n(.V>19 \
120
\{\
121
.    ds : e
122
.    ds 8 ss
123
.    ds o a
124
.    ds d- d\h'-1'\(ga
125
.    ds D- D\h'-1'\(hy
126
.    ds th \o'bp'
127
.    ds Th \o'LP'
128
.    ds ae ae
129
.    ds Ae AE
130
.\}
131
.rm #[ #] #H #V #F C
132
.\" ========================================================================
133
.\"
134
.IX Title "GFORTRAN 1"
135
.TH GFORTRAN 1 "2010-07-31" "gcc-4.5.1" "GNU"
136
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
137
.\" way too many mistakes in technical documents.
138
.if n .ad l
139
.nh
140
.SH "NAME"
141
gfortran \- GNU Fortran compiler
142
.SH "SYNOPSIS"
143
.IX Header "SYNOPSIS"
144
gfortran [\fB\-c\fR|\fB\-S\fR|\fB\-E\fR]
145
         [\fB\-g\fR] [\fB\-pg\fR] [\fB\-O\fR\fIlevel\fR]
146
         [\fB\-W\fR\fIwarn\fR...] [\fB\-pedantic\fR]
147
         [\fB\-I\fR\fIdir\fR...] [\fB\-L\fR\fIdir\fR...]
148
         [\fB\-D\fR\fImacro\fR[=\fIdefn\fR]...] [\fB\-U\fR\fImacro\fR]
149
         [\fB\-f\fR\fIoption\fR...]
150
         [\fB\-m\fR\fImachine-option\fR...]
151
         [\fB\-o\fR \fIoutfile\fR] \fIinfile\fR...
152
.PP
153
Only the most useful options are listed here; see below for the
154
remainder.
155
.SH "DESCRIPTION"
156
.IX Header "DESCRIPTION"
157
The \fBgfortran\fR command supports all the options supported by the
158
\&\fBgcc\fR command.  Only options specific to \s-1GNU\s0 Fortran are documented here.
159
.PP
160
All \s-1GCC\s0 and \s-1GNU\s0 Fortran options
161
are accepted both by \fBgfortran\fR and by \fBgcc\fR
162
(as well as any other drivers built at the same time,
163
such as \fBg++\fR),
164
since adding \s-1GNU\s0 Fortran to the \s-1GCC\s0 distribution
165
enables acceptance of \s-1GNU\s0 Fortran options
166
by all of the relevant drivers.
167
.PP
168
In some cases, options have positive and negative forms;
169
the negative form of \fB\-ffoo\fR would be \fB\-fno\-foo\fR.
170
This manual documents only one of these two forms, whichever
171
one is not the default.
172
.SH "OPTIONS"
173
.IX Header "OPTIONS"
174
Here is a summary of all the options specific to \s-1GNU\s0 Fortran, grouped
175
by type.  Explanations are in the following sections.
176
.IP "\fIFortran Language Options\fR" 4
177
.IX Item "Fortran Language Options"
178
\&\fB\-fall\-intrinsics  \-ffree\-form  \-fno\-fixed\-form
179
\&\-fdollar\-ok  \-fimplicit\-none  \-fmax\-identifier\-length
180
\&\-std=\fR\fIstd\fR \fB\-fd\-lines\-as\-code  \-fd\-lines\-as\-comments
181
\&\-ffixed\-line\-length\-\fR\fIn\fR  \fB\-ffixed\-line\-length\-none
182
\&\-ffree\-line\-length\-\fR\fIn\fR  \fB\-ffree\-line\-length\-none
183
\&\-fdefault\-double\-8  \-fdefault\-integer\-8  \-fdefault\-real\-8
184
\&\-fcray\-pointer  \-fopenmp  \-fno\-range\-check \-fbackslash \-fmodule\-private\fR
185
.IP "\fIPreprocessing Options\fR" 4
186
.IX Item "Preprocessing Options"
187
\&\fB\-cpp \-dD \-dI \-dM \-dN \-dU \-fworking\-directory
188
\&\-imultilib\fR \fIdir\fR \fB\-iprefix\fR \fIfile\fR \fB\-isysroot\fR \fIdir\fR
189
\&\fB\-iquote \-isystem\fR \fIdir\fR \fB\-nocpp \-nostdinc \-undef
190
\&\-A\fR\fIquestion\fR\fB=\fR\fIanswer\fR \fB\-A\-\fR\fIquestion\fR[\fB=\fR\fIanswer\fR]
191
\&\fB\-C \-CC \-D\fR\fImacro\fR[\fB=\fR\fIdefn\fR] \fB\-U\fR\fImacro\fR \fB\-H \-P\fR
192
.IP "\fIError and Warning Options\fR" 4
193
.IX Item "Error and Warning Options"
194
\&\fB\-fmax\-errors=\fR\fIn\fR
195
\&\fB\-fsyntax\-only  \-pedantic  \-pedantic\-errors
196
\&\-Wall  \-Waliasing  \-Wampersand  \-Warray\-bounds \-Wcharacter\-truncation
197
\&\-Wconversion \-Wimplicit\-interface  \-Wimplicit\-procedure  \-Wline\-truncation
198
\&\-Wintrinsics\-std  \-Wsurprising  \-Wno\-tabs  \-Wunderflow  \-Wunused\-parameter
199
\&\-Wintrinsics\-shadow  \-Wno\-align\-commons\fR
200
.IP "\fIDebugging Options\fR" 4
201
.IX Item "Debugging Options"
202
\&\fB\-fdump\-parse\-tree  \-ffpe\-trap=\fR\fIlist\fR
203
\&\fB\-fdump\-core \-fbacktrace\fR
204
.IP "\fIDirectory Options\fR" 4
205
.IX Item "Directory Options"
206
\&\fB\-I\fR\fIdir\fR  \fB\-J\fR\fIdir\fR  \fB\-M\fR\fIdir\fR
207
\&\fB\-fintrinsic\-modules\-path\fR \fIdir\fR
208
.IP "\fILink Options\fR" 4
209
.IX Item "Link Options"
210
\&\fB\-static\-libgfortran\fR
211
.IP "\fIRuntime Options\fR" 4
212
.IX Item "Runtime Options"
213
\&\fB\-fconvert=\fR\fIconversion\fR  \fB\-fno\-range\-check
214
\&\-frecord\-marker=\fR\fIlength\fR   \fB\-fmax\-subrecord\-length=\fR\fIlength\fR
215
\&\fB\-fsign\-zero\fR
216
.IP "\fICode Generation Options\fR" 4
217
.IX Item "Code Generation Options"
218
\&\fB\-fno\-automatic  \-ff2c  \-fno\-underscoring
219
\&\-fwhole\-file \-fsecond\-underscore
220
\&\-fbounds\-check \-fcheck\-array\-temporaries  \-fmax\-array\-constructor =\fR\fIn\fR
221
\&\fB\-fcheck=\fR\fI\fR
222
\&\fB\-fmax\-stack\-var\-size=\fR\fIn\fR
223
\&\fB\-fpack\-derived  \-frepack\-arrays  \-fshort\-enums  \-fexternal\-blas
224
\&\-fblas\-matmul\-limit=\fR\fIn\fR \fB\-frecursive \-finit\-local\-zero
225
\&\-finit\-integer=\fR\fIn\fR \fB\-finit\-real=\fR\fI\fR
226
\&\fB\-finit\-logical=\fR\fI\fR \fB\-finit\-character=\fR\fIn\fR
227
\&\fB\-fno\-align\-commons \-fno\-protect\-parens\fR
228
.Sh "Options controlling Fortran dialect"
229
.IX Subsection "Options controlling Fortran dialect"
230
The following options control the details of the Fortran dialect
231
accepted by the compiler:
232
.IP "\fB\-ffree\-form\fR" 4
233
.IX Item "-ffree-form"
234
.PD 0
235
.IP "\fB\-ffixed\-form\fR" 4
236
.IX Item "-ffixed-form"
237
.PD
238
Specify the layout used by the source file.  The free form layout
239
was introduced in Fortran 90.  Fixed form was traditionally used in
240
older Fortran programs.  When neither option is specified, the source
241
form is determined by the file extension.
242
.IP "\fB\-fall\-intrinsics\fR" 4
243
.IX Item "-fall-intrinsics"
244
This option causes all intrinsic procedures (including the GNU-specific
245
extensions) to be accepted.  This can be useful with \fB\-std=f95\fR to
246
force standard-compliance but get access to the full range of intrinsics
247
available with \fBgfortran\fR.  As a consequence, \fB\-Wintrinsics\-std\fR
248
will be ignored and no user-defined procedure with the same name as any
249
intrinsic will be called except when it is explicitly declared \f(CW\*(C`EXTERNAL\*(C'\fR.
250
.IP "\fB\-fd\-lines\-as\-code\fR" 4
251
.IX Item "-fd-lines-as-code"
252
.PD 0
253
.IP "\fB\-fd\-lines\-as\-comments\fR" 4
254
.IX Item "-fd-lines-as-comments"
255
.PD
256
Enable special treatment for lines beginning with \f(CW\*(C`d\*(C'\fR or \f(CW\*(C`D\*(C'\fR
257
in fixed form sources.  If the \fB\-fd\-lines\-as\-code\fR option is
258
given they are treated as if the first column contained a blank.  If the
259
\&\fB\-fd\-lines\-as\-comments\fR option is given, they are treated as
260
comment lines.
261
.IP "\fB\-fdefault\-double\-8\fR" 4
262
.IX Item "-fdefault-double-8"
263
Set the \f(CW\*(C`DOUBLE PRECISION\*(C'\fR type to an 8 byte wide type.  If
264
\&\fB\-fdefault\-real\-8\fR is given, \f(CW\*(C`DOUBLE PRECISION\*(C'\fR would
265
instead be promoted to 16 bytes if possible, and \fB\-fdefault\-double\-8\fR
266
can be used to prevent this.  The kind of real constants like \f(CW\*(C`1.d0\*(C'\fR will
267
not be changed by \fB\-fdefault\-real\-8\fR though, so also
268
\&\fB\-fdefault\-double\-8\fR does not affect it.
269
.IP "\fB\-fdefault\-integer\-8\fR" 4
270
.IX Item "-fdefault-integer-8"
271
Set the default integer and logical types to an 8 byte wide type.
272
Do nothing if this is already the default.  This option also affects
273
the kind of integer constants like \f(CW42\fR.
274
.IP "\fB\-fdefault\-real\-8\fR" 4
275
.IX Item "-fdefault-real-8"
276
Set the default real type to an 8 byte wide type.
277
Do nothing if this is already the default.  This option also affects
278
the kind of non-double real constants like \f(CW1.0\fR, and does promote
279
the default width of \f(CW\*(C`DOUBLE PRECISION\*(C'\fR to 16 bytes if possible, unless
280
\&\f(CW\*(C`\-fdefault\-double\-8\*(C'\fR is given, too.
281
.IP "\fB\-fdollar\-ok\fR" 4
282
.IX Item "-fdollar-ok"
283
Allow \fB$\fR as a valid non-first character in a symbol name. Symbols
284
that start with \fB$\fR are rejected since it is unclear which rules to
285
apply to implicit typing as different vendors implement different rules.
286
Using \fB$\fR in \f(CW\*(C`IMPLICIT\*(C'\fR statements is also rejected.
287
.IP "\fB\-fbackslash\fR" 4
288
.IX Item "-fbackslash"
289
Change the interpretation of backslashes in string literals from a single
290
backslash character to \*(L"C\-style\*(R" escape characters. The following
291
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,
292
\&\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
293
characters alert, backspace, form feed, newline, carriage return,
294
horizontal tab, vertical tab, backslash, and \s-1NUL\s0, respectively.
295
Additionally, \f(CW\*(C`\ex\*(C'\fR\fInn\fR, \f(CW\*(C`\eu\*(C'\fR\fInnnn\fR and
296
\&\f(CW\*(C`\eU\*(C'\fR\fInnnnnnnn\fR (where each \fIn\fR is a hexadecimal digit) are
297
translated into the Unicode characters corresponding to the specified code
298
points. All other combinations of a character preceded by \e are
299
unexpanded.
300
.IP "\fB\-fmodule\-private\fR" 4
301
.IX Item "-fmodule-private"
302
Set the default accessibility of module entities to \f(CW\*(C`PRIVATE\*(C'\fR.
303
Use-associated entities will not be accessible unless they are explicitly
304
declared as \f(CW\*(C`PUBLIC\*(C'\fR.
305
.IP "\fB\-ffixed\-line\-length\-\fR\fIn\fR" 4
306
.IX Item "-ffixed-line-length-n"
307
Set column after which characters are ignored in typical fixed-form
308
lines in the source file, and through which spaces are assumed (as
309
if padded to that length) after the ends of short fixed-form lines.
310
.Sp
311
Popular values for \fIn\fR include 72 (the
312
standard and the default), 80 (card image), and 132 (corresponding
313
to \*(L"extended-source\*(R" options in some popular compilers).
314
\&\fIn\fR may also be \fBnone\fR, meaning that the entire line is meaningful
315
and that continued character constants never have implicit spaces appended
316
to them to fill out the line.
317
\&\fB\-ffixed\-line\-length\-0\fR means the same thing as
318
\&\fB\-ffixed\-line\-length\-none\fR.
319
.IP "\fB\-ffree\-line\-length\-\fR\fIn\fR" 4
320
.IX Item "-ffree-line-length-n"
321
Set column after which characters are ignored in typical free-form
322
lines in the source file. The default value is 132.
323
\&\fIn\fR may be \fBnone\fR, meaning that the entire line is meaningful.
324
\&\fB\-ffree\-line\-length\-0\fR means the same thing as
325
\&\fB\-ffree\-line\-length\-none\fR.
326
.IP "\fB\-fmax\-identifier\-length=\fR\fIn\fR" 4
327
.IX Item "-fmax-identifier-length=n"
328
Specify the maximum allowed identifier length. Typical values are
329
31 (Fortran 95) and 63 (Fortran 2003 and Fortran 2008).
330
.IP "\fB\-fimplicit\-none\fR" 4
331
.IX Item "-fimplicit-none"
332
Specify that no implicit typing is allowed, unless overridden by explicit
333
\&\f(CW\*(C`IMPLICIT\*(C'\fR statements.  This is the equivalent of adding
334
\&\f(CW\*(C`implicit none\*(C'\fR to the start of every procedure.
335
.IP "\fB\-fcray\-pointer\fR" 4
336
.IX Item "-fcray-pointer"
337
Enable the Cray pointer extension, which provides C\-like pointer
338
functionality.
339
.IP "\fB\-fopenmp\fR" 4
340
.IX Item "-fopenmp"
341
Enable the OpenMP extensions.  This includes OpenMP \f(CW\*(C`!$omp\*(C'\fR directives
342
in free form
343
and \f(CW\*(C`c$omp\*(C'\fR, \f(CW*$omp\fR and \f(CW\*(C`!$omp\*(C'\fR directives in fixed form,
344
\&\f(CW\*(C`!$\*(C'\fR conditional compilation sentinels in free form
345
and \f(CW\*(C`c$\*(C'\fR, \f(CW\*(C`*$\*(C'\fR and \f(CW\*(C`!$\*(C'\fR sentinels in fixed form,
346
and when linking arranges for the OpenMP runtime library to be linked
347
in.  The option \fB\-fopenmp\fR implies \fB\-frecursive\fR.
348
.IP "\fB\-fno\-range\-check\fR" 4
349
.IX Item "-fno-range-check"
350
Disable range checking on results of simplification of constant
351
expressions during compilation.  For example, \s-1GNU\s0 Fortran will give
352
an error at compile time when simplifying \f(CW\*(C`a = 1. / 0\*(C'\fR.
353
With this option, no error will be given and \f(CW\*(C`a\*(C'\fR will be assigned
354
the value \f(CW\*(C`+Infinity\*(C'\fR.  If an expression evaluates to a value
355
outside of the relevant range of [\f(CW\*(C`\-HUGE()\*(C'\fR:\f(CW\*(C`HUGE()\*(C'\fR],
356
then the expression will be replaced by \f(CW\*(C`\-Inf\*(C'\fR or \f(CW\*(C`+Inf\*(C'\fR
357
as appropriate.
358
Similarly, \f(CW\*(C`DATA i/Z\*(AqFFFFFFFF\*(Aq/\*(C'\fR will result in an integer overflow
359
on most systems, but with \fB\-fno\-range\-check\fR the value will
360
\&\*(L"wrap around\*(R" and \f(CW\*(C`i\*(C'\fR will be initialized to \-1 instead.
361
.IP "\fB\-std=\fR\fIstd\fR" 4
362
.IX Item "-std=std"
363
Specify the standard to which the program is expected to conform, which
364
may be one of \fBf95\fR, \fBf2003\fR, \fBf2008\fR, \fBgnu\fR, or
365
\&\fBlegacy\fR.  The default value for \fIstd\fR is \fBgnu\fR, which
366
specifies a superset of the Fortran 95 standard that includes all of the
367
extensions supported by \s-1GNU\s0 Fortran, although warnings will be given for
368
obsolete extensions not recommended for use in new code.  The
369
\&\fBlegacy\fR value is equivalent but without the warnings for obsolete
370
extensions, and may be useful for old non-standard programs.  The
371
\&\fBf95\fR, \fBf2003\fR and \fBf2008\fR values specify strict
372
conformance to the Fortran 95, Fortran 2003 and Fortran 2008 standards,
373
respectively; errors are given for all extensions beyond the relevant
374
language standard, and warnings are given for the Fortran 77 features
375
that are permitted but obsolescent in later standards.
376
.Sh "Enable and customize preprocessing"
377
.IX Subsection "Enable and customize preprocessing"
378
Preprocessor related options. See section
379
\&\fBPreprocessing and conditional compilation\fR for more detailed
380
information on preprocessing in \fBgfortran\fR.
381
.IP "\fB\-cpp\fR" 4
382
.IX Item "-cpp"
383
.PD 0
384
.IP "\fB\-nocpp\fR" 4
385
.IX Item "-nocpp"
386
.PD
387
Enable preprocessing. The preprocessor is automatically invoked if
388
the file extension is \fI.fpp\fR, \fI.FPP\fR,  \fI.F\fR, \fI.FOR\fR,
389
\&\fI.FTN\fR, \fI.F90\fR, \fI.F95\fR, \fI.F03\fR or \fI.F08\fR. Use
390
this option to manually enable preprocessing of any kind of Fortran file.
391
.Sp
392
To disable preprocessing of files with any of the above listed extensions,
393
use the negative form: \fB\-nocpp\fR.
394
.Sp
395
The preprocessor is run in traditional mode, be aware that any
396
restrictions of the file-format, e.g. fixed-form line width,
397
apply for preprocessed output as well.
398
.IP "\fB\-dM\fR" 4
399
.IX Item "-dM"
400
Instead of the normal output, generate a list of \f(CW\*(Aq#define\*(Aq\fR
401
directives for all the macros defined during the execution of the
402
preprocessor, including predefined macros. This gives you a way
403
of finding out what is predefined in your version of the preprocessor.
404
Assuming you have no file \fIfoo.f90\fR, the command
405
.Sp
406
.Vb 1
407
\&          touch foo.f90; gfortran \-cpp \-dM foo.f90
408
.Ve
409
.Sp
410
will show all the predefined macros.
411
.IP "\fB\-dD\fR" 4
412
.IX Item "-dD"
413
Like \fB\-dM\fR except in two respects: it does not include the
414
predefined macros, and it outputs both the \f(CW\*(C`#define\*(C'\fR directives
415
and the result of preprocessing. Both kinds of output go to the
416
standard output file.
417
.IP "\fB\-dN\fR" 4
418
.IX Item "-dN"
419
Like \fB\-dD\fR, but emit only the macro names, not their expansions.
420
.IP "\fB\-dU\fR" 4
421
.IX Item "-dU"
422
Like \fBdD\fR except that only macros that are expanded, or whose
423
definedness is tested in preprocessor directives, are output; the
424
output is delayed until the use or test of the macro; and \f(CW\*(Aq#undef\*(Aq\fR
425
directives are also output for macros tested but undefined at the time.
426
.IP "\fB\-dI\fR" 4
427
.IX Item "-dI"
428
Output \f(CW\*(Aq#include\*(Aq\fR directives in addition to the result
429
of preprocessing.
430
.IP "\fB\-fworking\-directory\fR" 4
431
.IX Item "-fworking-directory"
432
Enable generation of linemarkers in the preprocessor output that will
433
let the compiler know the current working directory at the time of
434
preprocessing. When this option is enabled, the preprocessor will emit,
435
after the initial linemarker, a second linemarker with the current
436
working directory followed by two slashes. \s-1GCC\s0 will use this directory,
437
when it's present in the preprocessed input, as the directory emitted
438
as the current working directory in some debugging information formats.
439
This option is implicitly enabled if debugging information is enabled,
440
but this can be inhibited with the negated form
441
\&\fB\-fno\-working\-directory\fR. If the \fB\-P\fR flag is present
442
in the command line, this option has no effect, since no \f(CW\*(C`#line\*(C'\fR
443
directives are emitted whatsoever.
444
.IP "\fB\-idirafter\fR \fIdir\fR" 4
445
.IX Item "-idirafter dir"
446
Search \fIdir\fR for include files, but do it after all directories
447
specified with \fB\-I\fR and the standard system directories have
448
been exhausted. \fIdir\fR is treated as a system include directory.
449
If dir begins with \f(CW\*(C`=\*(C'\fR, then the \f(CW\*(C`=\*(C'\fR will be replaced by
450
the sysroot prefix; see \fB\-\-sysroot\fR and \fB\-isysroot\fR.
451
.IP "\fB\-imultilib\fR \fIdir\fR" 4
452
.IX Item "-imultilib dir"
453
Use \fIdir\fR as a subdirectory of the directory containing target-specific
454
\&\*(C+ headers.
455
.IP "\fB\-iprefix\fR \fIprefix\fR" 4
456
.IX Item "-iprefix prefix"
457
Specify \fIprefix\fR as the prefix for subsequent \fB\-iwithprefix\fR
458
options. If the \fIprefix\fR represents a directory, you should include
459
the final \f(CW\*(Aq/\*(Aq\fR.
460
.IP "\fB\-isysroot\fR \fIdir\fR" 4
461
.IX Item "-isysroot dir"
462
This option is like the \fB\-\-sysroot\fR option, but applies only to
463
header files. See the \fB\-\-sysroot\fR option for more information.
464
.IP "\fB\-iquote\fR \fIdir\fR" 4
465
.IX Item "-iquote dir"
466
Search \fIdir\fR only for header files requested with \f(CW\*(C`#include "file"\*(C'\fR;
467
they are not searched for \f(CW\*(C`#include \*(C'\fR, before all directories
468
specified by \fB\-I\fR and before the standard system directories. If
469
\&\fIdir\fR begins with \f(CW\*(C`=\*(C'\fR, then the \f(CW\*(C`=\*(C'\fR will be replaced by the
470
sysroot prefix; see \fB\-\-sysroot\fR and \fB\-isysroot\fR.
471
.IP "\fB\-isystem\fR \fIdir\fR" 4
472
.IX Item "-isystem dir"
473
Search \fIdir\fR for header files, after all directories specified by
474
\&\fB\-I\fR but before the standard system directories. Mark it as a
475
system directory, so that it gets the same special treatment as is
476
applied to the standard system directories. If \fIdir\fR begins with
477
\&\f(CW\*(C`=\*(C'\fR, then the \f(CW\*(C`=\*(C'\fR will be replaced by the sysroot prefix;
478
see \fB\-\-sysroot\fR and \fB\-isysroot\fR.
479
.IP "\fB\-nostdinc\fR" 4
480
.IX Item "-nostdinc"
481
Do not search the standard system directories for header files. Only
482
the directories you have specified with \fB\-I\fR options (and the
483
directory of the current file, if appropriate) are searched.
484
.IP "\fB\-undef\fR" 4
485
.IX Item "-undef"
486
Do not predefine any system-specific or GCC-specific macros.
487
The standard predefined macros remain defined.
488
.IP "\fB\-A\fR\fIpredicate\fR\fB=\fR\fIanswer\fR" 4
489
.IX Item "-Apredicate=answer"
490
Make an assertion with the predicate \fIpredicate\fR and answer \fIanswer\fR.
491
This form is preferred to the older form \-A predicate(answer), which is still
492
supported, because it does not use shell special characters.
493
.IP "\fB\-A\-\fR\fIpredicate\fR\fB=\fR\fIanswer\fR" 4
494
.IX Item "-A-predicate=answer"
495
Cancel an assertion with the predicate \fIpredicate\fR and answer \fIanswer\fR.
496
.IP "\fB\-C\fR" 4
497
.IX Item "-C"
498
Do not discard comments. All comments are passed through to the output
499
file, except for comments in processed directives, which are deleted
500
along with the directive.
501
.Sp
502
You should be prepared for side effects when using \fB\-C\fR; it causes
503
the preprocessor to treat comments as tokens in their own right. For example,
504
comments appearing at the start of what would be a directive line have the
505
effect of turning that line into an ordinary source line, since the first
506
token on the line is no longer a \f(CW\*(Aq#\*(Aq\fR.
507
.Sp
508
Warning: this currently handles C\-Style comments only. The preprocessor
509
does not yet recognize Fortran-style comments.
510
.IP "\fB\-CC\fR" 4
511
.IX Item "-CC"
512
Do not discard comments, including during macro expansion. This is like
513
\&\fB\-C\fR, except that comments contained within macros are also passed
514
through to the output file where the macro is expanded.
515
.Sp
516
In addition to the side-effects of the \fB\-C\fR option, the \fB\-CC\fR
517
option causes all \*(C+\-style comments inside a macro to be converted to C\-style
518
comments. This is to prevent later use of that macro from inadvertently
519
commenting out the remainder of the source line. The \fB\-CC\fR option
520
is generally used to support lint comments.
521
.Sp
522
Warning: this currently handles C\- and \*(C+\-Style comments only. The
523
preprocessor does not yet recognize Fortran-style comments.
524
.IP "\fB\-D\fR\fIname\fR" 4
525
.IX Item "-Dname"
526
Predefine name as a macro, with definition \f(CW1\fR.
527
.IP "\fB\-D\fR\fIname\fR\fB=\fR\fIdefinition\fR" 4
528
.IX Item "-Dname=definition"
529
The contents of \fIdefinition\fR are tokenized and processed as if they
530
appeared during translation phase three in a \f(CW\*(Aq#define\*(Aq\fR directive.
531
In particular, the definition will be truncated by embedded newline
532
characters.
533
.Sp
534
If you are invoking the preprocessor from a shell or shell-like program
535
you may need to use the shell's quoting syntax to protect characters such
536
as spaces that have a meaning in the shell syntax.
537
.Sp
538
If you wish to define a function-like macro on the command line, write
539
its argument list with surrounding parentheses before the equals sign
540
(if any). Parentheses are meaningful to most shells, so you will need
541
to quote the option. With sh and csh, \f(CW\*(C`\-D\*(Aqname(args...)=definition\*(Aq\*(C'\fR
542
works.
543
.Sp
544
\&\fB\-D\fR and \fB\-U\fR options are processed in the order they are
545
given on the command line. All \-imacros file and \-include file options
546
are processed after all \-D and \-U options.
547
.IP "\fB\-H\fR" 4
548
.IX Item "-H"
549
Print the name of each header file used, in addition to other normal
550
activities. Each name is indented to show how deep in the \f(CW\*(Aq#include\*(Aq\fR
551
stack it is.
552
.IP "\fB\-P\fR" 4
553
.IX Item "-P"
554
Inhibit generation of linemarkers in the output from the preprocessor.
555
This might be useful when running the preprocessor on something that
556
is not C code, and will be sent to a program which might be confused
557
by the linemarkers.
558
.IP "\fB\-U\fR\fIname\fR" 4
559
.IX Item "-Uname"
560
Cancel any previous definition of \fIname\fR, either built in or provided
561
with a \fB\-D\fR option.
562
.Sh "Options to request or suppress errors and warnings"
563
.IX Subsection "Options to request or suppress errors and warnings"
564
Errors are diagnostic messages that report that the \s-1GNU\s0 Fortran compiler
565
cannot compile the relevant piece of source code.  The compiler will
566
continue to process the program in an attempt to report further errors
567
to aid in debugging, but will not produce any compiled output.
568
.PP
569
Warnings are diagnostic messages that report constructions which
570
are not inherently erroneous but which are risky or suggest there is
571
likely to be a bug in the program.  Unless \fB\-Werror\fR is specified,
572
they do not prevent compilation of the program.
573
.PP
574
You can request many specific warnings with options beginning \fB\-W\fR,
575
for example \fB\-Wimplicit\fR to request warnings on implicit
576
declarations.  Each of these specific warning options also has a
577
negative form beginning \fB\-Wno\-\fR to turn off warnings;
578
for example, \fB\-Wno\-implicit\fR.  This manual lists only one of the
579
two forms, whichever is not the default.
580
.PP
581
These options control the amount and kinds of errors and warnings produced
582
by \s-1GNU\s0 Fortran:
583
.IP "\fB\-fmax\-errors=\fR\fIn\fR" 4
584
.IX Item "-fmax-errors=n"
585
Limits the maximum number of error messages to \fIn\fR, at which point
586
\&\s-1GNU\s0 Fortran bails out rather than attempting to continue processing the
587
source code.  If \fIn\fR is 0, there is no limit on the number of error
588
messages produced.
589
.IP "\fB\-fsyntax\-only\fR" 4
590
.IX Item "-fsyntax-only"
591
Check the code for syntax errors, but don't actually compile it.  This
592
will generate module files for each module present in the code, but no
593
other output file.
594
.IP "\fB\-pedantic\fR" 4
595
.IX Item "-pedantic"
596
Issue warnings for uses of extensions to Fortran 95.
597
\&\fB\-pedantic\fR also applies to C\-language constructs where they
598
occur in \s-1GNU\s0 Fortran source files, such as use of \fB\ee\fR in a
599
character constant within a directive like \f(CW\*(C`#include\*(C'\fR.
600
.Sp
601
Valid Fortran 95 programs should compile properly with or without
602
this option.
603
However, without this option, certain \s-1GNU\s0 extensions and traditional
604
Fortran features are supported as well.
605
With this option, many of them are rejected.
606
.Sp
607
Some users try to use \fB\-pedantic\fR to check programs for conformance.
608
They soon find that it does not do quite what they want\-\-\-it finds some
609
nonstandard practices, but not all.
610
However, improvements to \s-1GNU\s0 Fortran in this area are welcome.
611
.Sp
612
This should be used in conjunction with \fB\-std=f95\fR,
613
\&\fB\-std=f2003\fR or \fB\-std=f2008\fR.
614
.IP "\fB\-pedantic\-errors\fR" 4
615
.IX Item "-pedantic-errors"
616
Like \fB\-pedantic\fR, except that errors are produced rather than
617
warnings.
618
.IP "\fB\-Wall\fR" 4
619
.IX Item "-Wall"
620
Enables commonly used warning options pertaining to usage that
621
we recommend avoiding and that we believe are easy to avoid.
622
This currently includes \fB\-Waliasing\fR,
623
\&\fB\-Wampersand\fR, \fB\-Wsurprising\fR, \fB\-Wintrinsics\-std\fR,
624
\&\fB\-Wno\-tabs\fR, \fB\-Wintrinsic\-shadow\fR and \fB\-Wline\-truncation\fR.
625
.IP "\fB\-Waliasing\fR" 4
626
.IX Item "-Waliasing"
627
Warn about possible aliasing of dummy arguments. Specifically, it warns
628
if the same actual argument is associated with a dummy argument with
629
\&\f(CW\*(C`INTENT(IN)\*(C'\fR and a dummy argument with \f(CW\*(C`INTENT(OUT)\*(C'\fR in a call
630
with an explicit interface.
631
.Sp
632
The following example will trigger the warning.
633
.Sp
634
.Vb 7
635
\&          interface
636
\&            subroutine bar(a,b)
637
\&              integer, intent(in) :: a
638
\&              integer, intent(out) :: b
639
\&            end subroutine
640
\&          end interface
641
\&          integer :: a
642
\&
643
\&          call bar(a,a)
644
.Ve
645
.IP "\fB\-Wampersand\fR" 4
646
.IX Item "-Wampersand"
647
Warn about missing ampersand in continued character constants. The warning is
648
given with \fB\-Wampersand\fR, \fB\-pedantic\fR, \fB\-std=f95\fR,
649
\&\fB\-std=f2003\fR and \fB\-std=f2008\fR. Note: With no ampersand
650
given in a continued character constant, \s-1GNU\s0 Fortran assumes continuation
651
at the first non-comment, non-whitespace character after the ampersand
652
that initiated the continuation.
653
.IP "\fB\-Warray\-temporaries\fR" 4
654
.IX Item "-Warray-temporaries"
655
Warn about array temporaries generated by the compiler.  The information
656
generated by this warning is sometimes useful in optimization, in order to
657
avoid such temporaries.
658
.IP "\fB\-Wcharacter\-truncation\fR" 4
659
.IX Item "-Wcharacter-truncation"
660
Warn when a character assignment will truncate the assigned string.
661
.IP "\fB\-Wline\-truncation\fR" 4
662
.IX Item "-Wline-truncation"
663
Warn when a source code line will be truncated.
664
.IP "\fB\-Wconversion\fR" 4
665
.IX Item "-Wconversion"
666
Warn about implicit conversions between different types.
667
.IP "\fB\-Wimplicit\-interface\fR" 4
668
.IX Item "-Wimplicit-interface"
669
Warn if a procedure is called without an explicit interface.
670
Note this only checks that an explicit interface is present.  It does not
671
check that the declared interfaces are consistent across program units.
672
.IP "\fB\-Wimplicit\-procedure\fR" 4
673
.IX Item "-Wimplicit-procedure"
674
Warn if a procedure is called that has neither an explicit interface
675
nor has been declared as \f(CW\*(C`EXTERNAL\*(C'\fR.
676
.IP "\fB\-Wintrinsics\-std\fR" 4
677
.IX Item "-Wintrinsics-std"
678
Warn if \fBgfortran\fR finds a procedure named like an intrinsic not
679
available in the currently selected standard (with \fB\-std\fR) and treats
680
it as \f(CW\*(C`EXTERNAL\*(C'\fR procedure because of this.  \fB\-fall\-intrinsics\fR can
681
be used to never trigger this behavior and always link to the intrinsic
682
regardless of the selected standard.
683
.IP "\fB\-Wsurprising\fR" 4
684
.IX Item "-Wsurprising"
685
Produce a warning when \*(L"suspicious\*(R" code constructs are encountered.
686
While technically legal these usually indicate that an error has been made.
687
.Sp
688
This currently produces a warning under the following circumstances:
689
.RS 4
690
.IP "\(bu" 4
691
An \s-1INTEGER\s0 \s-1SELECT\s0 construct has a \s-1CASE\s0 that can never be matched as its
692
lower value is greater than its upper value.
693
.IP "\(bu" 4
694
A \s-1LOGICAL\s0 \s-1SELECT\s0 construct has three \s-1CASE\s0 statements.
695
.IP "\(bu" 4
696
A \s-1TRANSFER\s0 specifies a source that is shorter than the destination.
697
.IP "\(bu" 4
698
The type of a function result is declared more than once with the same type.  If
699
\&\fB\-pedantic\fR or standard-conforming mode is enabled, this is an error.
700
.IP "\(bu" 4
701
A \f(CW\*(C`CHARACTER\*(C'\fR variable is declared with negative length.
702
.RE
703
.RS 4
704
.RE
705
.IP "\fB\-Wtabs\fR" 4
706
.IX Item "-Wtabs"
707
By default, tabs are accepted as whitespace, but tabs are not members
708
of the Fortran Character Set.  For continuation lines, a tab followed
709
by a digit between 1 and 9 is supported.  \fB\-Wno\-tabs\fR will cause
710
a warning to be issued if a tab is encountered. Note, \fB\-Wno\-tabs\fR
711
is active for \fB\-pedantic\fR, \fB\-std=f95\fR, \fB\-std=f2003\fR,
712
\&\fB\-std=f2008\fR and \fB\-Wall\fR.
713
.IP "\fB\-Wunderflow\fR" 4
714
.IX Item "-Wunderflow"
715
Produce a warning when numerical constant expressions are
716
encountered, which yield an \s-1UNDERFLOW\s0 during compilation.
717
.IP "\fB\-Wintrinsic\-shadow\fR" 4
718
.IX Item "-Wintrinsic-shadow"
719
Warn if a user-defined procedure or module procedure has the same name as an
720
intrinsic; in this case, an explicit interface or \f(CW\*(C`EXTERNAL\*(C'\fR or
721
\&\f(CW\*(C`INTRINSIC\*(C'\fR declaration might be needed to get calls later resolved to
722
the desired intrinsic/procedure.
723
.IP "\fB\-Wunused\-parameter\fR" 4
724
.IX Item "-Wunused-parameter"
725
Contrary to \fBgcc\fR's meaning of \fB\-Wunused\-parameter\fR,
726
\&\fBgfortran\fR's implementation of this option does not warn
727
about unused dummy arguments, but about unused \f(CW\*(C`PARAMETER\*(C'\fR values.
728
\&\fB\-Wunused\-parameter\fR is not included in \fB\-Wall\fR but is
729
implied by \fB\-Wall \-Wextra\fR.
730
.IP "\fB\-Walign\-commons\fR" 4
731
.IX Item "-Walign-commons"
732
By default, \fBgfortran\fR warns about any occasion of variables being
733
padded for proper alignment inside a \s-1COMMON\s0 block. This warning can be turned
734
off via \fB\-Wno\-align\-commons\fR. See also \fB\-falign\-commons\fR.
735
.IP "\fB\-Werror\fR" 4
736
.IX Item "-Werror"
737
Turns all warnings into errors.
738
.PP
739
Some of these have no effect when compiling programs written in Fortran.
740
.Sh "Options for debugging your program or \s-1GNU\s0 Fortran"
741
.IX Subsection "Options for debugging your program or GNU Fortran"
742
\&\s-1GNU\s0 Fortran has various special options that are used for debugging
743
either your program or the \s-1GNU\s0 Fortran compiler.
744
.IP "\fB\-fdump\-parse\-tree\fR" 4
745
.IX Item "-fdump-parse-tree"
746
Output the internal parse tree before starting code generation.  Only
747
really useful for debugging the \s-1GNU\s0 Fortran compiler itself.
748
.IP "\fB\-ffpe\-trap=\fR\fIlist\fR" 4
749
.IX Item "-ffpe-trap=list"
750
Specify a list of \s-1IEEE\s0 exceptions when a Floating Point Exception
751
(\s-1FPE\s0) should be raised.  On most systems, this will result in a \s-1SIGFPE\s0
752
signal being sent and the program being interrupted, producing a core
753
file useful for debugging.  \fIlist\fR is a (possibly empty) comma-separated
754
list of the following \s-1IEEE\s0 exceptions: \fBinvalid\fR (invalid floating
755
point operation, such as \f(CW\*(C`SQRT(\-1.0)\*(C'\fR), \fBzero\fR (division by
756
zero), \fBoverflow\fR (overflow in a floating point operation),
757
\&\fBunderflow\fR (underflow in a floating point operation),
758
\&\fBprecision\fR (loss of precision during operation) and \fBdenormal\fR
759
(operation produced a denormal value).
760
.Sp
761
Some of the routines in the Fortran runtime library, like
762
\&\fB\s-1CPU_TIME\s0\fR, are likely to trigger floating point exceptions when
763
\&\f(CW\*(C`ffpe\-trap=precision\*(C'\fR is used. For this reason, the use of
764
\&\f(CW\*(C`ffpe\-trap=precision\*(C'\fR is not recommended.
765
.IP "\fB\-fbacktrace\fR" 4
766
.IX Item "-fbacktrace"
767
Specify that, when a runtime error is encountered or a deadly signal is
768
emitted (segmentation fault, illegal instruction, bus error or
769
floating-point exception), the Fortran runtime
770
library should output a backtrace of the error.  This option
771
only has influence for compilation of the Fortran main program.
772
.IP "\fB\-fdump\-core\fR" 4
773
.IX Item "-fdump-core"
774
Request that a core-dump file is written to disk when a runtime error
775
is encountered on systems that support core dumps. This option is
776
only effective for the compilation of the Fortran main program.
777
.Sh "Options for directory search"
778
.IX Subsection "Options for directory search"
779
These options affect how \s-1GNU\s0 Fortran searches
780
for files specified by the \f(CW\*(C`INCLUDE\*(C'\fR directive and where it searches
781
for previously compiled modules.
782
.PP
783
It also affects the search paths used by \fBcpp\fR when used to preprocess
784
Fortran source.
785
.IP "\fB\-I\fR\fIdir\fR" 4
786
.IX Item "-Idir"
787
These affect interpretation of the \f(CW\*(C`INCLUDE\*(C'\fR directive
788
(as well as of the \f(CW\*(C`#include\*(C'\fR directive of the \fBcpp\fR
789
preprocessor).
790
.Sp
791
Also note that the general behavior of \fB\-I\fR and
792
\&\f(CW\*(C`INCLUDE\*(C'\fR is pretty much the same as of \fB\-I\fR with
793
\&\f(CW\*(C`#include\*(C'\fR in the \fBcpp\fR preprocessor, with regard to
794
looking for \fIheader.gcc\fR files and other such things.
795
.Sp
796
This path is also used to search for \fI.mod\fR files when previously
797
compiled modules are required by a \f(CW\*(C`USE\*(C'\fR statement.
798
.IP "\fB\-J\fR\fIdir\fR" 4
799
.IX Item "-Jdir"
800
.PD 0
801
.IP "\fB\-M\fR\fIdir\fR" 4
802
.IX Item "-Mdir"
803
.PD
804
This option specifies where to put \fI.mod\fR files for compiled modules.
805
It is also added to the list of directories to searched by an \f(CW\*(C`USE\*(C'\fR
806
statement.
807
.Sp
808
The default is the current directory.
809
.Sp
810
\&\fB\-M\fR is deprecated to avoid conflicts with existing \s-1GCC\s0 options.
811
.IP "\fB\-fintrinsic\-modules\-path\fR \fIdir\fR" 4
812
.IX Item "-fintrinsic-modules-path dir"
813
This option specifies the location of pre-compiled intrinsic modules, if
814
they are not in the default location expected by the compiler.
815
.Sh "Influencing the linking step"
816
.IX Subsection "Influencing the linking step"
817
These options come into play when the compiler links object files into an
818
executable output file. They are meaningless if the compiler is not doing
819
a link step.
820
.IP "\fB\-static\-libgfortran\fR" 4
821
.IX Item "-static-libgfortran"
822
On systems that provide \fIlibgfortran\fR as a shared and a static
823
library, this option forces the use of the static version. If no
824
shared version of \fIlibgfortran\fR was built when the compiler was
825
configured, this option has no effect.
826
.Sh "Influencing runtime behavior"
827
.IX Subsection "Influencing runtime behavior"
828
These options affect the runtime behavior of programs compiled with \s-1GNU\s0 Fortran.
829
.IP "\fB\-fconvert=\fR\fIconversion\fR" 4
830
.IX Item "-fconvert=conversion"
831
Specify the representation of data for unformatted files.  Valid
832
values for conversion are: \fBnative\fR, the default; \fBswap\fR,
833
swap between big\- and little-endian; \fBbig-endian\fR, use big-endian
834
representation for unformatted files; \fBlittle-endian\fR, use little-endian
835
representation for unformatted files.
836
.Sp
837
\&\fIThis option has an effect only when used in the main program.
838
The \f(CI\*(C`CONVERT\*(C'\fI specifier and the \s-1GFORTRAN_CONVERT_UNIT\s0 environment
839
variable override the default specified by \f(BI\-fconvert\fI.\fR
840
.IP "\fB\-fno\-range\-check\fR" 4
841
.IX Item "-fno-range-check"
842
Disable range checking of input values during integer \f(CW\*(C`READ\*(C'\fR operations.
843
For example, \s-1GNU\s0 Fortran will give an error if an input value is
844
outside of the relevant range of [\f(CW\*(C`\-HUGE()\*(C'\fR:\f(CW\*(C`HUGE()\*(C'\fR]. In other words,
845
with \f(CW\*(C`INTEGER (kind=4) :: i\*(C'\fR , attempting to read \-2147483648 will
846
give an error unless \fB\-fno\-range\-check\fR is given.
847
.IP "\fB\-frecord\-marker=\fR\fIlength\fR" 4
848
.IX Item "-frecord-marker=length"
849
Specify the length of record markers for unformatted files.
850
Valid values for \fIlength\fR are 4 and 8.  Default is 4.
851
\&\fIThis is different from previous versions of\fR \fBgfortran\fR,
852
which specified a default record marker length of 8 on most
853
systems.  If you want to read or write files compatible
854
with earlier versions of \fBgfortran\fR, use \fB\-frecord\-marker=8\fR.
855
.IP "\fB\-fmax\-subrecord\-length=\fR\fIlength\fR" 4
856
.IX Item "-fmax-subrecord-length=length"
857
Specify the maximum length for a subrecord.  The maximum permitted
858
value for length is 2147483639, which is also the default.  Only
859
really useful for use by the gfortran testsuite.
860
.IP "\fB\-fsign\-zero\fR" 4
861
.IX Item "-fsign-zero"
862
When enabled, floating point numbers of value zero with the sign bit set
863
are written as negative number in formatted output and treated as
864
negative in the \f(CW\*(C`SIGN\*(C'\fR intrinsic.  \f(CW\*(C`fno\-sign\-zero\*(C'\fR does not
865
print the negative sign of zero values and regards zero as positive
866
number in the \f(CW\*(C`SIGN\*(C'\fR intrinsic for compatibility with F77.
867
Default behavior is to show the negative sign.
868
.Sh "Options for code generation conventions"
869
.IX Subsection "Options for code generation conventions"
870
These machine-independent options control the interface conventions
871
used in code generation.
872
.PP
873
Most of them have both positive and negative forms; the negative form
874
of \fB\-ffoo\fR would be \fB\-fno\-foo\fR.  In the table below, only
875
one of the forms is listed\-\-\-the one which is not the default.  You
876
can figure out the other form by either removing \fBno\-\fR or adding
877
it.
878
.IP "\fB\-fno\-automatic\fR" 4
879
.IX Item "-fno-automatic"
880
Treat each program unit (except those marked as \s-1RECURSIVE\s0) as if the
881
\&\f(CW\*(C`SAVE\*(C'\fR statement were specified for every local variable and array
882
referenced in it. Does not affect common blocks. (Some Fortran compilers
883
provide this option under the name \fB\-static\fR or \fB\-save\fR.)
884
The default, which is \fB\-fautomatic\fR, uses the stack for local
885
variables smaller than the value given by \fB\-fmax\-stack\-var\-size\fR.
886
Use the option \fB\-frecursive\fR to use no static memory.
887
.IP "\fB\-ff2c\fR" 4
888
.IX Item "-ff2c"
889
Generate code designed to be compatible with code generated
890
by \fBg77\fR and \fBf2c\fR.
891
.Sp
892
The calling conventions used by \fBg77\fR (originally implemented
893
in \fBf2c\fR) require functions that return type
894
default \f(CW\*(C`REAL\*(C'\fR to actually return the C type \f(CW\*(C`double\*(C'\fR, and
895
functions that return type \f(CW\*(C`COMPLEX\*(C'\fR to return the values via an
896
extra argument in the calling sequence that points to where to
897
store the return value.  Under the default \s-1GNU\s0 calling conventions, such
898
functions simply return their results as they would in \s-1GNU\s0
899
C\-\-\-default \f(CW\*(C`REAL\*(C'\fR functions return the C type \f(CW\*(C`float\*(C'\fR, and
900
\&\f(CW\*(C`COMPLEX\*(C'\fR functions return the \s-1GNU\s0 C type \f(CW\*(C`complex\*(C'\fR.
901
Additionally, this option implies the \fB\-fsecond\-underscore\fR
902
option, unless \fB\-fno\-second\-underscore\fR is explicitly requested.
903
.Sp
904
This does not affect the generation of code that interfaces with
905
the \fBlibgfortran\fR library.
906
.Sp
907
\&\fICaution:\fR It is not a good idea to mix Fortran code compiled with
908
\&\fB\-ff2c\fR with code compiled with the default \fB\-fno\-f2c\fR
909
calling conventions as, calling \f(CW\*(C`COMPLEX\*(C'\fR or default \f(CW\*(C`REAL\*(C'\fR
910
functions between program parts which were compiled with different
911
calling conventions will break at execution time.
912
.Sp
913
\&\fICaution:\fR This will break code which passes intrinsic functions
914
of type default \f(CW\*(C`REAL\*(C'\fR or \f(CW\*(C`COMPLEX\*(C'\fR as actual arguments, as
915
the library implementations use the \fB\-fno\-f2c\fR calling conventions.
916
.IP "\fB\-fno\-underscoring\fR" 4
917
.IX Item "-fno-underscoring"
918
Do not transform names of entities specified in the Fortran
919
source file by appending underscores to them.
920
.Sp
921
With \fB\-funderscoring\fR in effect, \s-1GNU\s0 Fortran appends one
922
underscore to external names with no underscores.  This is done to ensure
923
compatibility with code produced by many \s-1UNIX\s0 Fortran compilers.
924
.Sp
925
\&\fICaution\fR: The default behavior of \s-1GNU\s0 Fortran is
926
incompatible with \fBf2c\fR and \fBg77\fR, please use the
927
\&\fB\-ff2c\fR option if you want object files compiled with
928
\&\s-1GNU\s0 Fortran to be compatible with object code created with these
929
tools.
930
.Sp
931
Use of \fB\-fno\-underscoring\fR is not recommended unless you are
932
experimenting with issues such as integration of \s-1GNU\s0 Fortran into
933
existing system environments (vis\-@`{a}\-vis existing libraries, tools,
934
and so on).
935
.Sp
936
For example, with \fB\-funderscoring\fR, and assuming other defaults like
937
\&\fB\-fcase\-lower\fR and that \f(CW\*(C`j()\*(C'\fR and \f(CW\*(C`max_count()\*(C'\fR are
938
external functions while \f(CW\*(C`my_var\*(C'\fR and \f(CW\*(C`lvar\*(C'\fR are local variables,
939
a statement like
940
.Sp
941
.Vb 1
942
\&        I = J() + MAX_COUNT (MY_VAR, LVAR)
943
.Ve
944
.Sp
945
is implemented as something akin to:
946
.Sp
947
.Vb 1
948
\&        i = j_() + max_count_\|_(&my_var_\|_, &lvar);
949
.Ve
950
.Sp
951
With \fB\-fno\-underscoring\fR, the same statement is implemented as:
952
.Sp
953
.Vb 1
954
\&        i = j() + max_count(&my_var, &lvar);
955
.Ve
956
.Sp
957
Use of \fB\-fno\-underscoring\fR allows direct specification of
958
user-defined names while debugging and when interfacing \s-1GNU\s0 Fortran
959
code with other languages.
960
.Sp
961
Note that just because the names match does \fInot\fR mean that the
962
interface implemented by \s-1GNU\s0 Fortran for an external name matches the
963
interface implemented by some other language for that same name.
964
That is, getting code produced by \s-1GNU\s0 Fortran to link to code produced
965
by some other compiler using this or any other method can be only a
966
small part of the overall solution\-\-\-getting the code generated by
967
both compilers to agree on issues other than naming can require
968
significant effort, and, unlike naming disagreements, linkers normally
969
cannot detect disagreements in these other areas.
970
.Sp
971
Also, note that with \fB\-fno\-underscoring\fR, the lack of appended
972
underscores introduces the very real possibility that a user-defined
973
external name will conflict with a name in a system library, which
974
could make finding unresolved-reference bugs quite difficult in some
975
cases\-\-\-they might occur at program run time, and show up only as
976
buggy behavior at run time.
977
.Sp
978
In future versions of \s-1GNU\s0 Fortran we hope to improve naming and linking
979
issues so that debugging always involves using the names as they appear
980
in the source, even if the names as seen by the linker are mangled to
981
prevent accidental linking between procedures with incompatible
982
interfaces.
983
.IP "\fB\-fwhole\-file\fR" 4
984
.IX Item "-fwhole-file"
985
By default, \s-1GNU\s0 Fortran parses, resolves and translates each procedure
986
in a file separately.  Using this option modifies this such that the
987
whole file is parsed and placed in a single front-end tree.  During
988
resolution, in addition to all the usual checks and fixups, references
989
to external procedures that are in the same file effect resolution of
990
that procedure, if not already done, and a check of the interfaces. The
991
dependences are resolved by changing the order in which the file is
992
translated into the backend tree.  Thus, a procedure that is referenced
993
is translated before the reference and the duplication of backend tree
994
declarations eliminated.
995
.IP "\fB\-fsecond\-underscore\fR" 4
996
.IX Item "-fsecond-underscore"
997
By default, \s-1GNU\s0 Fortran appends an underscore to external
998
names.  If this option is used \s-1GNU\s0 Fortran appends two
999
underscores to names with underscores and one underscore to external names
1000
with no underscores.  \s-1GNU\s0 Fortran also appends two underscores to
1001
internal names with underscores to avoid naming collisions with external
1002
names.
1003
.Sp
1004
This option has no effect if \fB\-fno\-underscoring\fR is
1005
in effect.  It is implied by the \fB\-ff2c\fR option.
1006
.Sp
1007
Otherwise, with this option, an external name such as \f(CW\*(C`MAX_COUNT\*(C'\fR
1008
is implemented as a reference to the link-time external symbol
1009
\&\f(CW\*(C`max_count_\|_\*(C'\fR, instead of \f(CW\*(C`max_count_\*(C'\fR.  This is required
1010
for compatibility with \fBg77\fR and \fBf2c\fR, and is implied
1011
by use of the \fB\-ff2c\fR option.
1012
.IP "\fB\-fcheck=\fR\fI\fR" 4
1013
.IX Item "-fcheck="
1014
Enable the generation of run-time checks; the argument shall be
1015
a comma-delimited list of the following keywords.
1016
.RS 4
1017
.IP "\fBall\fR" 4
1018
.IX Item "all"
1019
Enable all run-time test of \fB\-fcheck\fR.
1020
.IP "\fBarray-temps\fR" 4
1021
.IX Item "array-temps"
1022
Warns at run time when for passing an actual argument a temporary array
1023
had to be generated. The information generated by this warning is
1024
sometimes useful in optimization, in order to avoid such temporaries.
1025
.Sp
1026
Note: The warning is only printed once per location.
1027
.IP "\fBbounds\fR" 4
1028
.IX Item "bounds"
1029
Enable generation of run-time checks for array subscripts
1030
and against the declared minimum and maximum values.  It also
1031
checks array indices for assumed and deferred
1032
shape arrays against the actual allocated bounds and ensures that all string
1033
lengths are equal for character array constructors without an explicit
1034
typespec.
1035
.Sp
1036
Some checks require that \fB\-fcheck=bounds\fR is set for
1037
the compilation of the main program.
1038
.Sp
1039
Note: In the future this may also include other forms of checking, e.g.,
1040
checking substring references.
1041
.IP "\fBdo\fR" 4
1042
.IX Item "do"
1043
Enable generation of run-time checks for invalid modification of loop
1044
iteration variables.
1045
.IP "\fBmem\fR" 4
1046
.IX Item "mem"
1047
Enable generation of run-time checks for memory allocation.
1048
Note: This option does not affect explicit allocations using the
1049
\&\f(CW\*(C`ALLOCATE\*(C'\fR statement, which will be always checked.
1050
.IP "\fBpointer\fR" 4
1051
.IX Item "pointer"
1052
Enable generation of run-time checks for pointers and allocatables.
1053
.IP "\fBrecursion\fR" 4
1054
.IX Item "recursion"
1055
Enable generation of run-time checks for recursively called subroutines and
1056
functions which are not marked as recursive. See also \fB\-frecursive\fR.
1057
Note: This check does not work for OpenMP programs and is disabled if used
1058
together with \fB\-frecursive\fR and \fB\-fopenmp\fR.
1059
.RE
1060
.RS 4
1061
.RE
1062
.IP "\fB\-fbounds\-check\fR" 4
1063
.IX Item "-fbounds-check"
1064
Deprecated alias for \fB\-fcheck=bounds\fR.
1065
.IP "\fB\-fcheck\-array\-temporaries\fR" 4
1066
.IX Item "-fcheck-array-temporaries"
1067
Deprecated alias for \fB\-fcheck=array\-temps\fR.
1068
.IP "\fB\-fmax\-array\-constructor=\fR\fIn\fR" 4
1069
.IX Item "-fmax-array-constructor=n"
1070
This option can be used to increase the upper limit permitted in
1071
array constructors.  The code below requires this option to expand
1072
the array at compile time.
1073
.Sp
1074
.Vb 7
1075
\&        C
1076
\&        C
1077
\&        C
1078
\&        C
1079
\&        C
1080
\&        C
1081
\&        C
1082
.Ve
1083
.Sp
1084
\&\fICaution:  This option can lead to long compile times and excessively
1085
large object files.\fR
1086
.Sp
1087
The default value for \fIn\fR is 65535.
1088
.IP "\fB\-fmax\-stack\-var\-size=\fR\fIn\fR" 4
1089
.IX Item "-fmax-stack-var-size=n"
1090
This option specifies the size in bytes of the largest array that will be put
1091
on the stack; if the size is exceeded static memory is used (except in
1092
procedures marked as \s-1RECURSIVE\s0). Use the option \fB\-frecursive\fR to
1093
allow for recursive procedures which do not have a \s-1RECURSIVE\s0 attribute or
1094
for parallel programs. Use \fB\-fno\-automatic\fR to never use the stack.
1095
.Sp
1096
This option currently only affects local arrays declared with constant
1097
bounds, and may not apply to all character variables.
1098
Future versions of \s-1GNU\s0 Fortran may improve this behavior.
1099
.Sp
1100
The default value for \fIn\fR is 32768.
1101
.IP "\fB\-fpack\-derived\fR" 4
1102
.IX Item "-fpack-derived"
1103
This option tells \s-1GNU\s0 Fortran to pack derived type members as closely as
1104
possible.  Code compiled with this option is likely to be incompatible
1105
with code compiled without this option, and may execute slower.
1106
.IP "\fB\-frepack\-arrays\fR" 4
1107
.IX Item "-frepack-arrays"
1108
In some circumstances \s-1GNU\s0 Fortran may pass assumed shape array
1109
sections via a descriptor describing a noncontiguous area of memory.
1110
This option adds code to the function prologue to repack the data into
1111
a contiguous block at runtime.
1112
.Sp
1113
This should result in faster accesses to the array.  However it can introduce
1114
significant overhead to the function call, especially  when the passed data
1115
is noncontiguous.
1116
.IP "\fB\-fshort\-enums\fR" 4
1117
.IX Item "-fshort-enums"
1118
This option is provided for interoperability with C code that was
1119
compiled with the \fB\-fshort\-enums\fR option.  It will make
1120
\&\s-1GNU\s0 Fortran choose the smallest \f(CW\*(C`INTEGER\*(C'\fR kind a given
1121
enumerator set will fit in, and give all its enumerators this kind.
1122
.IP "\fB\-fexternal\-blas\fR" 4
1123
.IX Item "-fexternal-blas"
1124
This option will make \fBgfortran\fR generate calls to \s-1BLAS\s0 functions
1125
for some matrix operations like \f(CW\*(C`MATMUL\*(C'\fR, instead of using our own
1126
algorithms, if the size of the matrices involved is larger than a given
1127
limit (see \fB\-fblas\-matmul\-limit\fR).  This may be profitable if an
1128
optimized vendor \s-1BLAS\s0 library is available.  The \s-1BLAS\s0 library will have
1129
to be specified at link time.
1130
.IP "\fB\-fblas\-matmul\-limit=\fR\fIn\fR" 4
1131
.IX Item "-fblas-matmul-limit=n"
1132
Only significant when \fB\-fexternal\-blas\fR is in effect.
1133
Matrix multiplication of matrices with size larger than (or equal to) \fIn\fR
1134
will be performed by calls to \s-1BLAS\s0 functions, while others will be
1135
handled by \fBgfortran\fR internal algorithms. If the matrices
1136
involved are not square, the size comparison is performed using the
1137
geometric mean of the dimensions of the argument and result matrices.
1138
.Sp
1139
The default value for \fIn\fR is 30.
1140
.IP "\fB\-frecursive\fR" 4
1141
.IX Item "-frecursive"
1142
Allow indirect recursion by forcing all local arrays to be allocated
1143
on the stack. This flag cannot be used together with
1144
\&\fB\-fmax\-stack\-var\-size=\fR or \fB\-fno\-automatic\fR.
1145
.IP "\fB\-finit\-local\-zero\fR" 4
1146
.IX Item "-finit-local-zero"
1147
.PD 0
1148
.IP "\fB\-finit\-integer=\fR\fIn\fR" 4
1149
.IX Item "-finit-integer=n"
1150
.IP "\fB\-finit\-real=\fR\fI\fR\fB \fR" 4
1151
.IX Item "-finit-real= "
1152
.IP "\fB\-finit\-logical=\fR\fI\fR" 4
1153
.IX Item "-finit-logical="
1154
.IP "\fB\-finit\-character=\fR\fIn\fR" 4
1155
.IX Item "-finit-character=n"
1156
.PD
1157
The \fB\-finit\-local\-zero\fR option instructs the compiler to
1158
initialize local \f(CW\*(C`INTEGER\*(C'\fR, \f(CW\*(C`REAL\*(C'\fR, and \f(CW\*(C`COMPLEX\*(C'\fR
1159
variables to zero, \f(CW\*(C`LOGICAL\*(C'\fR variables to false, and
1160
\&\f(CW\*(C`CHARACTER\*(C'\fR variables to a string of null bytes.  Finer-grained
1161
initialization options are provided by the
1162
\&\fB\-finit\-integer=\fR\fIn\fR,
1163
\&\fB\-finit\-real=\fR\fI\fR (which also initializes
1164
the real and imaginary parts of local \f(CW\*(C`COMPLEX\*(C'\fR variables),
1165
\&\fB\-finit\-logical=\fR\fI\fR, and
1166
\&\fB\-finit\-character=\fR\fIn\fR (where \fIn\fR is an \s-1ASCII\s0 character
1167
value) options.  These options do not initialize components of derived
1168
type variables, nor do they initialize variables that appear in an
1169
\&\f(CW\*(C`EQUIVALENCE\*(C'\fR statement.  (This limitation may be removed in
1170
future releases).
1171
.Sp
1172
Note that the \fB\-finit\-real=nan\fR option initializes \f(CW\*(C`REAL\*(C'\fR
1173
and \f(CW\*(C`COMPLEX\*(C'\fR variables with a quiet NaN. For a signalling NaN
1174
use \fB\-finit\-real=snan\fR; note, however, that compile-time
1175
optimizations may convert them into quiet NaN and that trapping
1176
needs to be enabled (e.g. via \fB\-ffpe\-trap\fR).
1177
.IP "\fB\-falign\-commons\fR" 4
1178
.IX Item "-falign-commons"
1179
By default, \fBgfortran\fR enforces proper alignment of all variables in a
1180
\&\s-1COMMON\s0 block by padding them as needed. On certain platforms this is mandatory,
1181
on others it increases performance. If a \s-1COMMON\s0 block is not declared with
1182
consistent data types everywhere, this padding can cause trouble, and
1183
\&\fB\-fno\-align\-commons\fR  can be used to disable automatic alignment. The
1184
same form of this option should be used for all files that share a \s-1COMMON\s0 block.
1185
To avoid potential alignment issues in \s-1COMMON\s0 blocks, it is recommended to order
1186
objects from largests to smallest.
1187
.IP "\fB\-fno\-protect\-parens\fR" 4
1188
.IX Item "-fno-protect-parens"
1189
By default the parentheses in expression are honored for all optimization
1190
levels such that the compiler does not do any re-association. Using
1191
\&\fB\-fno\-protect\-parens\fR allows the compiler to reorder \s-1REAL\s0 and
1192
\&\s-1COMPLEX\s0 expressions to produce faster code. Note that for the re-association
1193
optimization \fB\-fno\-signed\-zeros\fR and \fB\-fno\-trapping\-math\fR
1194
need to be in effect.
1195
.SH "ENVIRONMENT"
1196
.IX Header "ENVIRONMENT"
1197
The \fBgfortran\fR compiler currently does not make use of any environment
1198
variables to control its operation above and beyond those
1199
that affect the operation of \fBgcc\fR.
1200
.SH "BUGS"
1201
.IX Header "BUGS"
1202
For instructions on reporting bugs, see
1203
<\fBhttp://gcc.gnu.org/bugs.html\fR>.
1204
.SH "SEE ALSO"
1205
.IX Header "SEE ALSO"
1206
\&\fIgpl\fR\|(7), \fIgfdl\fR\|(7), \fIfsf\-funding\fR\|(7),
1207
\&\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)
1208
and the Info entries for \fIgcc\fR, \fIcpp\fR, \fIgfortran\fR, \fIas\fR,
1209
\&\fIld\fR, \fIbinutils\fR and \fIgdb\fR.
1210
.SH "AUTHOR"
1211
.IX Header "AUTHOR"
1212
See the Info entry for \fBgfortran\fR for contributors to \s-1GCC\s0 and
1213
\&\s-1GNU\s0 Fortran.
1214
.SH "COPYRIGHT"
1215
.IX Header "COPYRIGHT"
1216
Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009
1217
Free Software Foundation, Inc.
1218
.PP
1219
Permission is granted to copy, distribute and/or modify this document
1220
under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.2 or
1221
any later version published by the Free Software Foundation; with the
1222
Invariant Sections being \*(L"Funding Free Software\*(R", the Front-Cover
1223
Texts being (a) (see below), and with the Back-Cover Texts being (b)
1224
(see below).  A copy of the license is included in the \fIgfdl\fR\|(7) man page.
1225
.PP
1226
(a) The \s-1FSF\s0's Front-Cover Text is:
1227
.PP
1228
.Vb 1
1229
\&     A GNU Manual
1230
.Ve
1231
.PP
1232
(b) The \s-1FSF\s0's Back-Cover Text is:
1233
.PP
1234
.Vb 3
1235
\&     You have freedom to copy and modify this GNU Manual, like GNU
1236
\&     software.  Copies published by the Free Software Foundation raise
1237
\&     funds for GNU development.
1238
.Ve

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.