OSDN Git Service

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