Mention KTR_IFQ and KTR_IF_START
[dragonfly.git] / contrib / gcc-3.4 / gcc / doc / g77.1
1 .\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
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.  | will give a
29 .\" real vertical bar.  \*(C+ will give a nicer C++.  Capital omega is used to
30 .\" do unbreakable dashes and therefore won't be available.  \*(C` and \*(C'
31 .\" expand to `' in nroff, nothing in troff, for use with C<>.
32 .tr \(*W-|\(bv\*(Tr
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 .\" If the F register is turned on, we'll generate index entries on stderr for
52 .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
53 .\" entries marked with X<> in POD.  Of course, you'll have to process the
54 .\" output yourself in some meaningful fashion.
55 .if \nF \{\
56 .    de IX
57 .    tm Index:\\$1\t\\n%\t"\\$2"
58 ..
59 .    nr % 0
60 .    rr F
61 .\}
62 .\"
63 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
64 .\" way too many mistakes in technical documents.
65 .hy 0
66 .if n .na
67 .\"
68 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
70 .    \" fudge factors for nroff and troff
71 .if n \{\
72 .    ds #H 0
73 .    ds #V .8m
74 .    ds #F .3m
75 .    ds #[ \f1
76 .    ds #] \fP
77 .\}
78 .if t \{\
79 .    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80 .    ds #V .6m
81 .    ds #F 0
82 .    ds #[ \&
83 .    ds #] \&
84 .\}
85 .    \" simple accents for nroff and troff
86 .if n \{\
87 .    ds ' \&
88 .    ds ` \&
89 .    ds ^ \&
90 .    ds , \&
91 .    ds ~ ~
92 .    ds /
93 .\}
94 .if t \{\
95 .    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96 .    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97 .    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98 .    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99 .    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100 .    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
101 .\}
102 .    \" troff and (daisy-wheel) nroff accents
103 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110 .ds ae a\h'-(\w'a'u*4/10)'e
111 .ds Ae A\h'-(\w'A'u*4/10)'E
112 .    \" corrections for vroff
113 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115 .    \" for low resolution devices (crt and lpr)
116 .if \n(.H>23 .if \n(.V>19 \
117 \{\
118 .    ds : e
119 .    ds 8 ss
120 .    ds o a
121 .    ds d- d\h'-1'\(ga
122 .    ds D- D\h'-1'\(hy
123 .    ds th \o'bp'
124 .    ds Th \o'LP'
125 .    ds ae ae
126 .    ds Ae AE
127 .\}
128 .rm #[ #] #H #V #F C
129 .\" ========================================================================
130 .\"
131 .IX Title "G77 1"
132 .TH G77 1 "2006-03-06" "gcc-3.4.6" "GNU"
133 .SH "NAME"
134 g77 \- GNU project Fortran 77 compiler
135 .SH "SYNOPSIS"
136 .IX Header "SYNOPSIS"
137 g77 [\fB\-c\fR|\fB\-S\fR|\fB\-E\fR]
138     [\fB\-g\fR] [\fB\-pg\fR] [\fB\-O\fR\fIlevel\fR]
139     [\fB\-W\fR\fIwarn\fR...] [\fB\-pedantic\fR]
140     [\fB\-I\fR\fIdir\fR...] [\fB\-L\fR\fIdir\fR...]
141     [\fB\-D\fR\fImacro\fR[=\fIdefn\fR]...] [\fB\-U\fR\fImacro\fR]
142     [\fB\-f\fR\fIoption\fR...] [\fB\-m\fR\fImachine-option\fR...]
143     [\fB\-o\fR \fIoutfile\fR] \fIinfile\fR...
144 .PP
145 Only the most useful options are listed here; see below for the
146 remainder.
147 .SH "DESCRIPTION"
148 .IX Header "DESCRIPTION"
149 The \fBg77\fR command supports all the options supported by the
150 \&\fBgcc\fR command.
151 .PP
152 All \fBgcc\fR and \fBg77\fR options
153 are accepted both by \fBg77\fR and by \fBgcc\fR
154 (as well as any other drivers built at the same time,
155 such as \fBg++\fR),
156 since adding \fBg77\fR to the \fBgcc\fR distribution
157 enables acceptance of \fBg77\fR options
158 by all of the relevant drivers.
159 .PP
160 In some cases, options have positive and negative forms;
161 the negative form of \fB\-ffoo\fR would be \fB\-fno\-foo\fR.
162 This manual documents only one of these two forms, whichever
163 one is not the default.
164 .SH "OPTIONS"
165 .IX Header "OPTIONS"
166 Here is a summary of all the options specific to \s-1GNU\s0 Fortran, grouped
167 by type.  Explanations are in the following sections.
168 .IP "\fIOverall Options\fR" 4
169 .IX Item "Overall Options"
170 \&\fB\-fversion  \-fset\-g77\-defaults  \-fno\-silent\fR
171 .IP "\fIShorthand Options\fR" 4
172 .IX Item "Shorthand Options"
173 \&\fB\-ff66  \-fno\-f66  \-ff77  \-fno\-f77  \-fno\-ugly\fR
174 .IP "\fIFortran Language Options\fR" 4
175 .IX Item "Fortran Language Options"
176 \&\fB\-ffree\-form  \-fno\-fixed\-form  \-ff90 
177 \&\-fvxt  \-fdollar\-ok  \-fno\-backslash 
178 \&\-fno\-ugly\-args  \-fno\-ugly\-assign  \-fno\-ugly\-assumed 
179 \&\-fugly\-comma  \-fugly\-complex  \-fugly\-init  \-fugly\-logint 
180 \&\-fonetrip  \-ftypeless\-boz 
181 \&\-fintrin\-case\-initcap  \-fintrin\-case\-upper 
182 \&\-fintrin\-case\-lower  \-fintrin\-case\-any 
183 \&\-fmatch\-case\-initcap  \-fmatch\-case\-upper 
184 \&\-fmatch\-case\-lower  \-fmatch\-case\-any 
185 \&\-fsource\-case\-upper  \-fsource\-case\-lower 
186 \&\-fsource\-case\-preserve 
187 \&\-fsymbol\-case\-initcap  \-fsymbol\-case\-upper 
188 \&\-fsymbol\-case\-lower  \-fsymbol\-case\-any 
189 \&\-fcase\-strict\-upper  \-fcase\-strict\-lower 
190 \&\-fcase\-initcap  \-fcase\-upper  \-fcase\-lower  \-fcase\-preserve 
191 \&\-ff2c\-intrinsics\-delete  \-ff2c\-intrinsics\-hide 
192 \&\-ff2c\-intrinsics\-disable  \-ff2c\-intrinsics\-enable 
193 \&\-fbadu77\-intrinsics\-delete  \-fbadu77\-intrinsics\-hide 
194 \&\-fbadu77\-intrinsics\-disable  \-fbadu77\-intrinsics\-enable 
195 \&\-ff90\-intrinsics\-delete  \-ff90\-intrinsics\-hide 
196 \&\-ff90\-intrinsics\-disable  \-ff90\-intrinsics\-enable 
197 \&\-fgnu\-intrinsics\-delete  \-fgnu\-intrinsics\-hide 
198 \&\-fgnu\-intrinsics\-disable  \-fgnu\-intrinsics\-enable 
199 \&\-fmil\-intrinsics\-delete  \-fmil\-intrinsics\-hide 
200 \&\-fmil\-intrinsics\-disable  \-fmil\-intrinsics\-enable 
201 \&\-funix\-intrinsics\-delete  \-funix\-intrinsics\-hide 
202 \&\-funix\-intrinsics\-disable  \-funix\-intrinsics\-enable 
203 \&\-fvxt\-intrinsics\-delete  \-fvxt\-intrinsics\-hide 
204 \&\-fvxt\-intrinsics\-disable  \-fvxt\-intrinsics\-enable 
205 \&\-ffixed\-line\-length\-\fR\fIn\fR  \fB\-ffixed\-line\-length\-none\fR
206 .IP "\fIWarning Options\fR" 4
207 .IX Item "Warning Options"
208 \&\fB\-fsyntax\-only  \-pedantic  \-pedantic\-errors  \-fpedantic 
209 \&\-w  \-Wno\-globals  \-Wimplicit  \-Wunused  \-Wuninitialized 
210 \&\-Wall  \-Wsurprising 
211 \&\-Werror  \-W\fR
212 .IP "\fIDebugging Options\fR" 4
213 .IX Item "Debugging Options"
214 \&\fB\-g\fR
215 .IP "\fIOptimization Options\fR" 4
216 .IX Item "Optimization Options"
217 \&\fB\-malign\-double 
218 \&\-ffloat\-store  \-fforce\-mem  \-fforce\-addr  \-fno\-inline 
219 \&\-ffast\-math  \-fstrength\-reduce  \-frerun\-cse\-after\-loop 
220 \&\-funsafe\-math\-optimizations \-ffinite\-math\-only \-fno\-trapping\-math 
221 \&\-fexpensive\-optimizations  \-fdelayed\-branch 
222 \&\-fschedule\-insns  \-fschedule\-insn2  \-fcaller\-saves 
223 \&\-funroll\-loops  \-funroll\-all\-loops 
224 \&\-fno\-move\-all\-movables  \-fno\-reduce\-all\-givs 
225 \&\-fno\-rerun\-loop\-opt\fR
226 .IP "\fIDirectory Options\fR" 4
227 .IX Item "Directory Options"
228 \&\fB\-I\fR\fIdir\fR  \fB\-I\-\fR
229 .IP "\fICode Generation Options\fR" 4
230 .IX Item "Code Generation Options"
231 \&\fB\-fno\-automatic  \-finit\-local\-zero  \-fno\-f2c 
232 \&\-ff2c\-library  \-fno\-underscoring  \-fno\-ident 
233 \&\-fpcc\-struct\-return  \-freg\-struct\-return 
234 \&\-fshort\-double  \-fno\-common  \-fpack\-struct 
235 \&\-fzeros  \-fno\-second\-underscore 
236 \&\-femulate\-complex 
237 \&\-falias\-check  \-fargument\-alias 
238 \&\-fargument\-noalias  \-fno\-argument\-noalias\-global 
239 \&\-fno\-globals  \-fflatten\-arrays 
240 \&\-fbounds\-check  \-ffortran\-bounds\-check\fR
241 .PP
242 Compilation can involve as many as four stages: preprocessing, code
243 generation (often what is really meant by the term ``compilation''),
244 assembly, and linking, always in that order.  The first three
245 stages apply to an individual source file, and end by producing an
246 object file; linking combines all the object files (those newly
247 compiled, and those specified as input) into an executable file.
248 .PP
249 For any given input file, the file name suffix determines what kind of
250 program is contained in the file\-\-\-that is, the language in which the
251 program is written is generally indicated by the suffix.
252 Suffixes specific to \s-1GNU\s0 Fortran are listed below.
253 .IP "\fIfile\fR\fB.f\fR" 4
254 .IX Item "file.f"
255 .PD 0
256 .IP "\fIfile\fR\fB.for\fR" 4
257 .IX Item "file.for"
258 .IP "\fIfile\fR\fB.FOR\fR" 4
259 .IX Item "file.FOR"
260 .PD
261 Fortran source code that should not be preprocessed.
262 .Sp
263 Such source code cannot contain any preprocessor directives, such
264 as \f(CW\*(C`#include\*(C'\fR, \f(CW\*(C`#define\*(C'\fR, \f(CW\*(C`#if\*(C'\fR, and so on.
265 .Sp
266 You can force \fB.f\fR files to be preprocessed by \fBcpp\fR by using
267 \&\fB\-x f77\-cpp\-input\fR.
268 .IP "\fIfile\fR\fB.F\fR" 4
269 .IX Item "file.F"
270 .PD 0
271 .IP "\fIfile\fR\fB.fpp\fR" 4
272 .IX Item "file.fpp"
273 .IP "\fIfile\fR\fB.FPP\fR" 4
274 .IX Item "file.FPP"
275 .PD
276 Fortran source code that must be preprocessed (by the C preprocessor
277 \&\fBcpp\fR, which is part of \s-1GCC\s0).
278 .Sp
279 Note that preprocessing is not extended to the contents of
280 files included by the \f(CW\*(C`INCLUDE\*(C'\fR directive\-\-\-the \f(CW\*(C`#include\*(C'\fR
281 preprocessor directive must be used instead.
282 .IP "\fIfile\fR\fB.r\fR" 4
283 .IX Item "file.r"
284 Ratfor source code, which must be preprocessed by the \fBratfor\fR
285 command, which is available separately (as it is not yet part of the \s-1GNU\s0
286 Fortran distribution).
287 A public domain version in C is at
288 <\fBhttp://sepwww.stanford.edu/sep/prof/ratfor.shar.2\fR>.
289 .PP
290 \&\s-1UNIX\s0 users typically use the \fI\fIfile\fI.f\fR and \fI\fIfile\fI.F\fR
291 nomenclature.
292 Users of other operating systems, especially those that cannot
293 distinguish upper-case
294 letters from lower-case letters in their file names, typically use
295 the \fI\fIfile\fI.for\fR and \fI\fIfile\fI.fpp\fR nomenclature.
296 .PP
297 Use of the preprocessor \fBcpp\fR allows use of C\-like
298 constructs such as \f(CW\*(C`#define\*(C'\fR and \f(CW\*(C`#include\*(C'\fR, but can
299 lead to unexpected, even mistaken, results due to Fortran's source file
300 format.
301 It is recommended that use of the C preprocessor
302 be limited to \f(CW\*(C`#include\*(C'\fR and, in
303 conjunction with \f(CW\*(C`#define\*(C'\fR, only \f(CW\*(C`#if\*(C'\fR and related directives,
304 thus avoiding in-line macro expansion entirely.
305 This recommendation applies especially
306 when using the traditional fixed source form.
307 With free source form,
308 fewer unexpected transformations are likely to happen, but use of
309 constructs such as Hollerith and character constants can nevertheless
310 present problems, especially when these are continued across multiple
311 source lines.
312 These problems result, primarily, from differences between the way
313 such constants are interpreted by the C preprocessor and by a Fortran
314 compiler.
315 .PP
316 Another example of a problem that results from using the C preprocessor
317 is that a Fortran comment line that happens to contain any
318 characters ``interesting'' to the C preprocessor,
319 such as a backslash at the end of the line,
320 is not recognized by the preprocessor as a comment line,
321 so instead of being passed through ``raw'',
322 the line is edited according to the rules for the preprocessor.
323 For example, the backslash at the end of the line is removed,
324 along with the subsequent newline, resulting in the next
325 line being effectively commented out\-\-\-unfortunate if that
326 line is a non-comment line of important code!
327 .PP
328 \&\fINote:\fR The \fB\-traditional\fR and \fB\-undef\fR flags are supplied
329 to \fBcpp\fR by default, to help avoid unpleasant surprises.
330 .PP
331 This means that \s-1ANSI\s0 C preprocessor features (such as the \fB#\fR
332 operator) aren't available, and only variables in the C reserved
333 namespace (generally, names with a leading underscore) are liable to
334 substitution by C predefines.
335 Thus, if you want to do system-specific
336 tests, use, for example, \fB#ifdef _\|_linux_\|_\fR rather than \fB#ifdef linux\fR.
337 Use the \fB\-v\fR option to see exactly how the preprocessor is invoked.
338 .PP
339 Unfortunately, the \fB\-traditional\fR flag will not avoid an error from
340 anything that \fBcpp\fR sees as an unterminated C comment, such as:
341 .PP
342 .Vb 2
343 \&        C Some Fortran compilers accept /* as starting
344 \&        C an inline comment.
345 .Ve
346 .PP
347 The following options that affect overall processing are recognized
348 by the \fBg77\fR and \fBgcc\fR commands in a \s-1GNU\s0 Fortran installation:
349 .IP "\fB\-fversion\fR" 4
350 .IX Item "-fversion"
351 Ensure that the \fBg77\fR version of the compiler phase is reported,
352 if run,
353 and, starting in \f(CW\*(C`egcs\*(C'\fR version 1.1,
354 that internal consistency checks in the \fIf771\fR program are run.
355 .Sp
356 This option is supplied automatically when \fB\-v\fR or \fB\-\-verbose\fR
357 is specified as a command-line option for \fBg77\fR or \fBgcc\fR
358 and when the resulting commands compile Fortran source files.
359 .Sp
360 In \s-1GCC\s0 3.1, this is changed back to the behavior \fBgcc\fR displays
361 for \fB.c\fR files.
362 .IP "\fB\-fset\-g77\-defaults\fR" 4
363 .IX Item "-fset-g77-defaults"
364 \&\fIVersion info:\fR
365 This option was obsolete as of \f(CW\*(C`egcs\*(C'\fR
366 version 1.1.
367 The effect is instead achieved
368 by the \f(CW\*(C`lang_init_options\*(C'\fR routine
369 in \fIgcc/gcc/f/com.c\fR.
370 .Sp
371 Set up whatever \fBgcc\fR options are to apply to Fortran
372 compilations, and avoid running internal consistency checks
373 that might take some time.
374 .Sp
375 This option is supplied automatically when compiling Fortran code
376 via the \fBg77\fR or \fBgcc\fR command.
377 The description of this option is provided so that users seeing
378 it in the output of, say, \fBg77 \-v\fR understand why it is
379 there.
380 .Sp
381 Also, developers who run \f(CW\*(C`f771\*(C'\fR directly might want to specify it
382 by hand to get the same defaults as they would running \f(CW\*(C`f771\*(C'\fR
383 via \fBg77\fR or \fBgcc\fR
384 However, such developers should, after linking a new \f(CW\*(C`f771\*(C'\fR
385 executable, invoke it without this option once,
386 e.g. via \f(CW\*(C`./f771 \-quiet < /dev/null\*(C'\fR,
387 to ensure that they have not introduced any
388 internal inconsistencies (such as in the table of
389 intrinsics) before proceeding\-\-\-\fBg77\fR will crash
390 with a diagnostic if it detects an inconsistency.
391 .IP "\fB\-fno\-silent\fR" 4
392 .IX Item "-fno-silent"
393 Print (to \f(CW\*(C`stderr\*(C'\fR) the names of the program units as
394 they are compiled, in a form similar to that used by popular
395 \&\s-1UNIX\s0 \fBf77\fR implementations and \fBf2c\fR
396 .Sh "Shorthand Options"
397 .IX Subsection "Shorthand Options"
398 The following options serve as ``shorthand''
399 for other options accepted by the compiler:
400 .IP "\fB\-fugly\fR" 4
401 .IX Item "-fugly"
402 \&\fINote:\fR This option is no longer supported.
403 The information, below, is provided to aid
404 in the conversion of old scripts.
405 .Sp
406 Specify that certain ``ugly'' constructs are to be quietly accepted.
407 Same as:
408 .Sp
409 .Vb 3
410 \&        -fugly-args -fugly-assign -fugly-assumed
411 \&        -fugly-comma -fugly-complex -fugly-init
412 \&        -fugly-logint
413 .Ve
414 .Sp
415 These constructs are considered inappropriate to use in new
416 or well-maintained portable Fortran code, but widely used
417 in old code.
418 .IP "\fB\-fno\-ugly\fR" 4
419 .IX Item "-fno-ugly"
420 Specify that all ``ugly'' constructs are to be noisily rejected.
421 Same as:
422 .Sp
423 .Vb 3
424 \&        -fno-ugly-args -fno-ugly-assign -fno-ugly-assumed
425 \&        -fno-ugly-comma -fno-ugly-complex -fno-ugly-init
426 \&        -fno-ugly-logint
427 .Ve
428 .IP "\fB\-ff66\fR" 4
429 .IX Item "-ff66"
430 Specify that the program is written in idiomatic \s-1FORTRAN\s0 66.
431 Same as \fB\-fonetrip \-fugly\-assumed\fR.
432 .Sp
433 The \fB\-fno\-f66\fR option is the inverse of \fB\-ff66\fR.
434 As such, it is the same as \fB\-fno\-onetrip \-fno\-ugly\-assumed\fR.
435 .Sp
436 The meaning of this option is likely to be refined as future
437 versions of \fBg77\fR provide more compatibility with other
438 existing and obsolete Fortran implementations.
439 .IP "\fB\-ff77\fR" 4
440 .IX Item "-ff77"
441 Specify that the program is written in idiomatic \s-1UNIX\s0 \s-1FORTRAN\s0 77
442 and/or the dialect accepted by the \fBf2c\fR product.
443 Same as \fB\-fbackslash \-fno\-typeless\-boz\fR.
444 .Sp
445 The meaning of this option is likely to be refined as future
446 versions of \fBg77\fR provide more compatibility with other
447 existing and obsolete Fortran implementations.
448 .IP "\fB\-fno\-f77\fR" 4
449 .IX Item "-fno-f77"
450 The \fB\-fno\-f77\fR option is \fInot\fR the inverse
451 of \fB\-ff77\fR.
452 It specifies that the program is not written in idiomatic \s-1UNIX\s0
453 \&\s-1FORTRAN\s0 77 or \fBf2c\fR but in a more widely portable dialect.
454 \&\fB\-fno\-f77\fR is the same as \fB\-fno\-backslash\fR.
455 .Sp
456 The meaning of this option is likely to be refined as future
457 versions of \fBg77\fR provide more compatibility with other
458 existing and obsolete Fortran implementations.
459 .Sh "Options Controlling Fortran Dialect"
460 .IX Subsection "Options Controlling Fortran Dialect"
461 The following options control the dialect of Fortran
462 that the compiler accepts:
463 .IP "\fB\-ffree\-form\fR" 4
464 .IX Item "-ffree-form"
465 .PD 0
466 .IP "\fB\-fno\-fixed\-form\fR" 4
467 .IX Item "-fno-fixed-form"
468 .PD
469 Specify that the source file is written in free form
470 (introduced in Fortran 90) instead of the more-traditional fixed form.
471 .IP "\fB\-ff90\fR" 4
472 .IX Item "-ff90"
473 Allow certain Fortran\-90 constructs.
474 .Sp
475 This option controls whether certain
476 Fortran 90 constructs are recognized.
477 (Other Fortran 90 constructs
478 might or might not be recognized depending on other options such as
479 \&\fB\-fvxt\fR, \fB\-ff90\-intrinsics\-enable\fR, and the
480 current level of support for Fortran 90.)
481 .IP "\fB\-fvxt\fR" 4
482 .IX Item "-fvxt"
483 Specify the treatment of certain constructs that have different
484 meanings depending on whether the code is written in
485 \&\s-1GNU\s0 Fortran (based on \s-1FORTRAN\s0 77 and akin to Fortran 90)
486 or \s-1VXT\s0 Fortran (more like \s-1VAX\s0 \s-1FORTRAN\s0).
487 .Sp
488 The default is \fB\-fno\-vxt\fR.
489 \&\fB\-fvxt\fR specifies that the \s-1VXT\s0 Fortran interpretations
490 for those constructs are to be chosen.
491 .IP "\fB\-fdollar\-ok\fR" 4
492 .IX Item "-fdollar-ok"
493 Allow \fB$\fR as a valid character in a symbol name.
494 .IP "\fB\-fno\-backslash\fR" 4
495 .IX Item "-fno-backslash"
496 Specify that \fB\e\fR is not to be specially interpreted in character
497 and Hollerith constants a la C and many \s-1UNIX\s0 Fortran compilers.
498 .Sp
499 For example, with \fB\-fbackslash\fR in effect, \fBA\enB\fR specifies
500 three characters, with the second one being newline.
501 With \fB\-fno\-backslash\fR, it specifies four characters,
502 \&\fBA\fR, \fB\e\fR, \fBn\fR, and \fBB\fR.
503 .Sp
504 Note that \fBg77\fR implements a fairly general form of backslash
505 processing that is incompatible with the narrower forms supported
506 by some other compilers.
507 For example, \fB'A\e003B'\fR is a three-character string in \fBg77\fR
508 whereas other compilers that support backslash might not support
509 the three-octal-digit form, and thus treat that string as longer
510 than three characters.
511 .IP "\fB\-fno\-ugly\-args\fR" 4
512 .IX Item "-fno-ugly-args"
513 Disallow passing Hollerith and typeless constants as actual
514 arguments (for example, \fB\s-1CALL\s0 \s-1FOO\s0(4HABCD)\fR).
515 .IP "\fB\-fugly\-assign\fR" 4
516 .IX Item "-fugly-assign"
517 Use the same storage for a given variable regardless of
518 whether it is used to hold an assigned-statement label
519 (as in \fB\s-1ASSIGN\s0 10 \s-1TO\s0 I\fR) or used to hold numeric data
520 (as in \fBI = 3\fR).
521 .IP "\fB\-fugly\-assumed\fR" 4
522 .IX Item "-fugly-assumed"
523 Assume any dummy array with a final dimension specified as \fB1\fR
524 is really an assumed-size array, as if \fB*\fR had been specified
525 for the final dimension instead of \fB1\fR.
526 .Sp
527 For example, \fB\s-1DIMENSION\s0 X(1)\fR is treated as if it
528 had read \fB\s-1DIMENSION\s0 X(*)\fR.
529 .IP "\fB\-fugly\-comma\fR" 4
530 .IX Item "-fugly-comma"
531 In an external-procedure invocation,
532 treat a trailing comma in the argument list
533 as specification of a trailing null argument,
534 and treat an empty argument list
535 as specification of a single null argument.
536 .Sp
537 For example, \fB\s-1CALL\s0 \s-1FOO\s0(,)\fR is treated as
538 \&\fB\s-1CALL\s0 \s-1FOO\s0(%\f(BIVAL\fB\|(0), %\f(BIVAL\fB\|(0))\fR.
539 That is, \fItwo\fR null arguments are specified
540 by the procedure call when \fB\-fugly\-comma\fR is in force.
541 And \fBF = \s-1\f(BIFUNC\s0()\fB\fR is treated as \fBF = \s-1FUNC\s0(%\f(BIVAL\fB\|(0))\fR.
542 .Sp
543 The default behavior, \fB\-fno\-ugly\-comma\fR, is to ignore
544 a single trailing comma in an argument list.
545 So, by default, \fB\s-1CALL\s0 \s-1FOO\s0(X,)\fR is treated
546 exactly the same as \fB\s-1CALL\s0 \s-1FOO\s0(X)\fR.
547 .IP "\fB\-fugly\-complex\fR" 4
548 .IX Item "-fugly-complex"
549 Do not complain about \fB\s-1REAL\s0(\fR\fIexpr\fR\fB)\fR or
550 \&\fB\s-1AIMAG\s0(\fR\fIexpr\fR\fB)\fR when \fIexpr\fR is a \f(CW\*(C`COMPLEX\*(C'\fR
551 type other than \f(CW\*(C`COMPLEX(KIND=1)\*(C'\fR\-\-\-usually
552 this is used to permit \f(CW\*(C`COMPLEX(KIND=2)\*(C'\fR
553 (\f(CW\*(C`DOUBLE COMPLEX\*(C'\fR) operands.
554 .Sp
555 The \fB\-ff90\fR option controls the interpretation
556 of this construct.
557 .IP "\fB\-fno\-ugly\-init\fR" 4
558 .IX Item "-fno-ugly-init"
559 Disallow use of Hollerith and typeless constants as initial
560 values (in \f(CW\*(C`PARAMETER\*(C'\fR and \f(CW\*(C`DATA\*(C'\fR statements), and
561 use of character constants to
562 initialize numeric types and vice versa.
563 .Sp
564 For example, \fB\s-1DATA\s0 I/'F'/, \s-1CHRVAR/65/\s0, J/4HABCD/\fR is disallowed by
565 \&\fB\-fno\-ugly\-init\fR.
566 .IP "\fB\-fugly\-logint\fR" 4
567 .IX Item "-fugly-logint"
568 Treat \f(CW\*(C`INTEGER\*(C'\fR and \f(CW\*(C`LOGICAL\*(C'\fR variables and
569 expressions as potential stand-ins for each other.
570 .Sp
571 For example, automatic conversion between \f(CW\*(C`INTEGER\*(C'\fR and
572 \&\f(CW\*(C`LOGICAL\*(C'\fR is enabled, for many contexts, via this option.
573 .IP "\fB\-fonetrip\fR" 4
574 .IX Item "-fonetrip"
575 Executable iterative \f(CW\*(C`DO\*(C'\fR loops are to be executed at
576 least once each time they are reached.
577 .Sp
578 \&\s-1ANSI\s0 \s-1FORTRAN\s0 77 and more recent versions of the Fortran standard
579 specify that the body of an iterative \f(CW\*(C`DO\*(C'\fR loop is not executed
580 if the number of iterations calculated from the parameters of the
581 loop is less than 1.
582 (For example, \fB\s-1DO\s0 10 I = 1, 0\fR.)
583 Such a loop is called a \fIzero-trip loop\fR.
584 .Sp
585 Prior to \s-1ANSI\s0 \s-1FORTRAN\s0 77, many compilers implemented \f(CW\*(C`DO\*(C'\fR loops
586 such that the body of a loop would be executed at least once, even
587 if the iteration count was zero.
588 Fortran code written assuming this behavior is said to require
589 \&\fIone-trip loops\fR.
590 For example, some code written to the \s-1FORTRAN\s0 66 standard
591 expects this behavior from its \f(CW\*(C`DO\*(C'\fR loops, although that
592 standard did not specify this behavior.
593 .Sp
594 The \fB\-fonetrip\fR option specifies that the source file(s) being
595 compiled require one-trip loops.
596 .Sp
597 This option affects only those loops specified by the (iterative) \f(CW\*(C`DO\*(C'\fR
598 statement and by implied\-\f(CW\*(C`DO\*(C'\fR lists in I/O statements.
599 Loops specified by implied\-\f(CW\*(C`DO\*(C'\fR lists in \f(CW\*(C`DATA\*(C'\fR and
600 specification (non\-executable) statements are not affected.
601 .IP "\fB\-ftypeless\-boz\fR" 4
602 .IX Item "-ftypeless-boz"
603 Specifies that prefix-radix non-decimal constants, such as
604 \&\fBZ'\s-1ABCD\s0'\fR, are typeless instead of \f(CW\*(C`INTEGER(KIND=1)\*(C'\fR.
605 .Sp
606 You can test for yourself whether a particular compiler treats
607 the prefix form as \f(CW\*(C`INTEGER(KIND=1)\*(C'\fR or typeless by running the
608 following program:
609 .Sp
610 .Vb 6
611 \&        EQUIVALENCE (I, R)
612 \&        R = Z'ABCD1234'
613 \&        J = Z'ABCD1234'
614 \&        IF (J .EQ. I) PRINT *, 'Prefix form is TYPELESS'
615 \&        IF (J .NE. I) PRINT *, 'Prefix form is INTEGER'
616 \&        END
617 .Ve
618 .Sp
619 Reports indicate that many compilers process this form as
620 \&\f(CW\*(C`INTEGER(KIND=1)\*(C'\fR, though a few as typeless, and at least one
621 based on a command-line option specifying some kind of
622 compatibility.
623 .IP "\fB\-fintrin\-case\-initcap\fR" 4
624 .IX Item "-fintrin-case-initcap"
625 .PD 0
626 .IP "\fB\-fintrin\-case\-upper\fR" 4
627 .IX Item "-fintrin-case-upper"
628 .IP "\fB\-fintrin\-case\-lower\fR" 4
629 .IX Item "-fintrin-case-lower"
630 .IP "\fB\-fintrin\-case\-any\fR" 4
631 .IX Item "-fintrin-case-any"
632 .PD
633 Specify expected case for intrinsic names.
634 \&\fB\-fintrin\-case\-lower\fR is the default.
635 .IP "\fB\-fmatch\-case\-initcap\fR" 4
636 .IX Item "-fmatch-case-initcap"
637 .PD 0
638 .IP "\fB\-fmatch\-case\-upper\fR" 4
639 .IX Item "-fmatch-case-upper"
640 .IP "\fB\-fmatch\-case\-lower\fR" 4
641 .IX Item "-fmatch-case-lower"
642 .IP "\fB\-fmatch\-case\-any\fR" 4
643 .IX Item "-fmatch-case-any"
644 .PD
645 Specify expected case for keywords.
646 \&\fB\-fmatch\-case\-lower\fR is the default.
647 .IP "\fB\-fsource\-case\-upper\fR" 4
648 .IX Item "-fsource-case-upper"
649 .PD 0
650 .IP "\fB\-fsource\-case\-lower\fR" 4
651 .IX Item "-fsource-case-lower"
652 .IP "\fB\-fsource\-case\-preserve\fR" 4
653 .IX Item "-fsource-case-preserve"
654 .PD
655 Specify whether source text other than character and Hollerith constants
656 is to be translated to uppercase, to lowercase, or preserved as is.
657 \&\fB\-fsource\-case\-lower\fR is the default.
658 .IP "\fB\-fsymbol\-case\-initcap\fR" 4
659 .IX Item "-fsymbol-case-initcap"
660 .PD 0
661 .IP "\fB\-fsymbol\-case\-upper\fR" 4
662 .IX Item "-fsymbol-case-upper"
663 .IP "\fB\-fsymbol\-case\-lower\fR" 4
664 .IX Item "-fsymbol-case-lower"
665 .IP "\fB\-fsymbol\-case\-any\fR" 4
666 .IX Item "-fsymbol-case-any"
667 .PD
668 Specify valid cases for user-defined symbol names.
669 \&\fB\-fsymbol\-case\-any\fR is the default.
670 .IP "\fB\-fcase\-strict\-upper\fR" 4
671 .IX Item "-fcase-strict-upper"
672 Same as \fB\-fintrin\-case\-upper \-fmatch\-case\-upper \-fsource\-case\-preserve
673 \&\-fsymbol\-case\-upper\fR.
674 (Requires all pertinent source to be in uppercase.)
675 .IP "\fB\-fcase\-strict\-lower\fR" 4
676 .IX Item "-fcase-strict-lower"
677 Same as \fB\-fintrin\-case\-lower \-fmatch\-case\-lower \-fsource\-case\-preserve
678 \&\-fsymbol\-case\-lower\fR.
679 (Requires all pertinent source to be in lowercase.)
680 .IP "\fB\-fcase\-initcap\fR" 4
681 .IX Item "-fcase-initcap"
682 Same as \fB\-fintrin\-case\-initcap \-fmatch\-case\-initcap \-fsource\-case\-preserve
683 \&\-fsymbol\-case\-initcap\fR.
684 (Requires all pertinent source to be in initial capitals,
685 as in \fBPrint *,SqRt(Value)\fR.)
686 .IP "\fB\-fcase\-upper\fR" 4
687 .IX Item "-fcase-upper"
688 Same as \fB\-fintrin\-case\-any \-fmatch\-case\-any \-fsource\-case\-upper
689 \&\-fsymbol\-case\-any\fR.
690 (Maps all pertinent source to uppercase.)
691 .IP "\fB\-fcase\-lower\fR" 4
692 .IX Item "-fcase-lower"
693 Same as \fB\-fintrin\-case\-any \-fmatch\-case\-any \-fsource\-case\-lower
694 \&\-fsymbol\-case\-any\fR.
695 (Maps all pertinent source to lowercase.)
696 .IP "\fB\-fcase\-preserve\fR" 4
697 .IX Item "-fcase-preserve"
698 Same as \fB\-fintrin\-case\-any \-fmatch\-case\-any \-fsource\-case\-preserve
699 \&\-fsymbol\-case\-any\fR.
700 (Preserves all case in user-defined symbols,
701 while allowing any-case matching of intrinsics and keywords.
702 For example, \fBcall Foo(i,I)\fR would pass two \fIdifferent\fR
703 variables named \fBi\fR and \fBI\fR to a procedure named \fBFoo\fR.)
704 .IP "\fB\-fbadu77\-intrinsics\-delete\fR" 4
705 .IX Item "-fbadu77-intrinsics-delete"
706 .PD 0
707 .IP "\fB\-fbadu77\-intrinsics\-hide\fR" 4
708 .IX Item "-fbadu77-intrinsics-hide"
709 .IP "\fB\-fbadu77\-intrinsics\-disable\fR" 4
710 .IX Item "-fbadu77-intrinsics-disable"
711 .IP "\fB\-fbadu77\-intrinsics\-enable\fR" 4
712 .IX Item "-fbadu77-intrinsics-enable"
713 .PD
714 Specify status of \s-1UNIX\s0 intrinsics having inappropriate forms.
715 \&\fB\-fbadu77\-intrinsics\-enable\fR is the default.
716 .IP "\fB\-ff2c\-intrinsics\-delete\fR" 4
717 .IX Item "-ff2c-intrinsics-delete"
718 .PD 0
719 .IP "\fB\-ff2c\-intrinsics\-hide\fR" 4
720 .IX Item "-ff2c-intrinsics-hide"
721 .IP "\fB\-ff2c\-intrinsics\-disable\fR" 4
722 .IX Item "-ff2c-intrinsics-disable"
723 .IP "\fB\-ff2c\-intrinsics\-enable\fR" 4
724 .IX Item "-ff2c-intrinsics-enable"
725 .PD
726 Specify status of f2c\-specific intrinsics.
727 \&\fB\-ff2c\-intrinsics\-enable\fR is the default.
728 .IP "\fB\-ff90\-intrinsics\-delete\fR" 4
729 .IX Item "-ff90-intrinsics-delete"
730 .PD 0
731 .IP "\fB\-ff90\-intrinsics\-hide\fR" 4
732 .IX Item "-ff90-intrinsics-hide"
733 .IP "\fB\-ff90\-intrinsics\-disable\fR" 4
734 .IX Item "-ff90-intrinsics-disable"
735 .IP "\fB\-ff90\-intrinsics\-enable\fR" 4
736 .IX Item "-ff90-intrinsics-enable"
737 .PD
738 Specify status of F90\-specific intrinsics.
739 \&\fB\-ff90\-intrinsics\-enable\fR is the default.
740 .IP "\fB\-fgnu\-intrinsics\-delete\fR" 4
741 .IX Item "-fgnu-intrinsics-delete"
742 .PD 0
743 .IP "\fB\-fgnu\-intrinsics\-hide\fR" 4
744 .IX Item "-fgnu-intrinsics-hide"
745 .IP "\fB\-fgnu\-intrinsics\-disable\fR" 4
746 .IX Item "-fgnu-intrinsics-disable"
747 .IP "\fB\-fgnu\-intrinsics\-enable\fR" 4
748 .IX Item "-fgnu-intrinsics-enable"
749 .PD
750 Specify status of Digital's COMPLEX-related intrinsics.
751 \&\fB\-fgnu\-intrinsics\-enable\fR is the default.
752 .IP "\fB\-fmil\-intrinsics\-delete\fR" 4
753 .IX Item "-fmil-intrinsics-delete"
754 .PD 0
755 .IP "\fB\-fmil\-intrinsics\-hide\fR" 4
756 .IX Item "-fmil-intrinsics-hide"
757 .IP "\fB\-fmil\-intrinsics\-disable\fR" 4
758 .IX Item "-fmil-intrinsics-disable"
759 .IP "\fB\-fmil\-intrinsics\-enable\fR" 4
760 .IX Item "-fmil-intrinsics-enable"
761 .PD
762 Specify status of MIL\-STD\-1753\-specific intrinsics.
763 \&\fB\-fmil\-intrinsics\-enable\fR is the default.
764 .IP "\fB\-funix\-intrinsics\-delete\fR" 4
765 .IX Item "-funix-intrinsics-delete"
766 .PD 0
767 .IP "\fB\-funix\-intrinsics\-hide\fR" 4
768 .IX Item "-funix-intrinsics-hide"
769 .IP "\fB\-funix\-intrinsics\-disable\fR" 4
770 .IX Item "-funix-intrinsics-disable"
771 .IP "\fB\-funix\-intrinsics\-enable\fR" 4
772 .IX Item "-funix-intrinsics-enable"
773 .PD
774 Specify status of \s-1UNIX\s0 intrinsics.
775 \&\fB\-funix\-intrinsics\-enable\fR is the default.
776 .IP "\fB\-fvxt\-intrinsics\-delete\fR" 4
777 .IX Item "-fvxt-intrinsics-delete"
778 .PD 0
779 .IP "\fB\-fvxt\-intrinsics\-hide\fR" 4
780 .IX Item "-fvxt-intrinsics-hide"
781 .IP "\fB\-fvxt\-intrinsics\-disable\fR" 4
782 .IX Item "-fvxt-intrinsics-disable"
783 .IP "\fB\-fvxt\-intrinsics\-enable\fR" 4
784 .IX Item "-fvxt-intrinsics-enable"
785 .PD
786 Specify status of \s-1VXT\s0 intrinsics.
787 \&\fB\-fvxt\-intrinsics\-enable\fR is the default.
788 .IP "\fB\-ffixed\-line\-length\-\fR\fIn\fR" 4
789 .IX Item "-ffixed-line-length-n"
790 Set column after which characters are ignored in typical fixed-form
791 lines in the source file, and through which spaces are assumed (as
792 if padded to that length) after the ends of short fixed-form lines.
793 .Sp
794 Popular values for \fIn\fR include 72 (the
795 standard and the default), 80 (card image), and 132 (corresponds
796 to ``extended\-source'' options in some popular compilers).
797 \&\fIn\fR may be \fBnone\fR, meaning that the entire line is meaningful
798 and that continued character constants never have implicit spaces appended
799 to them to fill out the line.
800 \&\fB\-ffixed\-line\-length\-0\fR means the same thing as
801 \&\fB\-ffixed\-line\-length\-none\fR.
802 .Sh "Options to Request or Suppress Warnings"
803 .IX Subsection "Options to Request or Suppress Warnings"
804 Warnings are diagnostic messages that report constructions which
805 are not inherently erroneous but which are risky or suggest there
806 might have been an error.
807 .PP
808 You can request many specific warnings with options beginning \fB\-W\fR,
809 for example \fB\-Wimplicit\fR to request warnings on implicit
810 declarations.  Each of these specific warning options also has a
811 negative form beginning \fB\-Wno\-\fR to turn off warnings;
812 for example, \fB\-Wno\-implicit\fR.  This manual lists only one of the
813 two forms, whichever is not the default.
814 .PP
815 These options control the amount and kinds of warnings produced by \s-1GNU\s0
816 Fortran:
817 .IP "\fB\-fsyntax\-only\fR" 4
818 .IX Item "-fsyntax-only"
819 Check the code for syntax errors, but don't do anything beyond that.
820 .IP "\fB\-pedantic\fR" 4
821 .IX Item "-pedantic"
822 Issue warnings for uses of extensions to \s-1ANSI\s0 \s-1FORTRAN\s0 77.
823 \&\fB\-pedantic\fR also applies to C\-language constructs where they
824 occur in \s-1GNU\s0 Fortran source files, such as use of \fB\ee\fR in a
825 character constant within a directive like \fB#include\fR.
826 .Sp
827 Valid \s-1ANSI\s0 \s-1FORTRAN\s0 77 programs should compile properly with or without
828 this option.
829 However, without this option, certain \s-1GNU\s0 extensions and traditional
830 Fortran features are supported as well.
831 With this option, many of them are rejected.
832 .Sp
833 Some users try to use \fB\-pedantic\fR to check programs for strict \s-1ANSI\s0
834 conformance.
835 They soon find that it does not do quite what they want\-\-\-it finds some
836 non-ANSI practices, but not all.
837 However, improvements to \fBg77\fR in this area are welcome.
838 .IP "\fB\-pedantic\-errors\fR" 4
839 .IX Item "-pedantic-errors"
840 Like \fB\-pedantic\fR, except that errors are produced rather than
841 warnings.
842 .IP "\fB\-fpedantic\fR" 4
843 .IX Item "-fpedantic"
844 Like \fB\-pedantic\fR, but applies only to Fortran constructs.
845 .IP "\fB\-w\fR" 4
846 .IX Item "-w"
847 Inhibit all warning messages.
848 .IP "\fB\-Wno\-globals\fR" 4
849 .IX Item "-Wno-globals"
850 Inhibit warnings about use of a name as both a global name
851 (a subroutine, function, or block data program unit, or a
852 common block) and implicitly as the name of an intrinsic
853 in a source file.
854 .Sp
855 Also inhibit warnings about inconsistent invocations and/or
856 definitions of global procedures (function and subroutines).
857 Such inconsistencies include different numbers of arguments
858 and different types of arguments.
859 .IP "\fB\-Wimplicit\fR" 4
860 .IX Item "-Wimplicit"
861 Warn whenever a variable, array, or function is implicitly
862 declared.
863 Has an effect similar to using the \f(CW\*(C`IMPLICIT NONE\*(C'\fR statement
864 in every program unit.
865 (Some Fortran compilers provide this feature by an option
866 named \fB\-u\fR or \fB/WARNINGS=DECLARATIONS\fR.)
867 .IP "\fB\-Wunused\fR" 4
868 .IX Item "-Wunused"
869 Warn whenever a variable is unused aside from its declaration.
870 .IP "\fB\-Wuninitialized\fR" 4
871 .IX Item "-Wuninitialized"
872 Warn whenever an automatic variable is used without first being initialized.
873 .Sp
874 These warnings are possible only in optimizing compilation,
875 because they require data-flow information that is computed only
876 when optimizing.  If you don't specify \fB\-O\fR, you simply won't
877 get these warnings.
878 .Sp
879 These warnings occur only for variables that are candidates for
880 register allocation.  Therefore, they do not occur for a variable
881 whose address is taken, or whose size
882 is other than 1, 2, 4 or 8 bytes.  Also, they do not occur for
883 arrays, even when they are in registers.
884 .Sp
885 Note that there might be no warning about a variable that is used only
886 to compute a value that itself is never used, because such
887 computations may be deleted by data-flow analysis before the warnings
888 are printed.
889 .Sp
890 These warnings are made optional because \s-1GNU\s0 Fortran is not smart
891 enough to see all the reasons why the code might be correct
892 despite appearing to have an error.  Here is one example of how
893 this can happen:
894 .Sp
895 .Vb 6
896 \&        SUBROUTINE DISPAT(J)
897 \&        IF (J.EQ.1) I=1
898 \&        IF (J.EQ.2) I=4
899 \&        IF (J.EQ.3) I=5
900 \&        CALL FOO(I)
901 \&        END
902 .Ve
903 .Sp
904 If the value of \f(CW\*(C`J\*(C'\fR is always 1, 2 or 3, then \f(CW\*(C`I\*(C'\fR is
905 always initialized, but \s-1GNU\s0 Fortran doesn't know this.  Here is
906 another common case:
907 .Sp
908 .Vb 6
909 \&        SUBROUTINE MAYBE(FLAG)
910 \&        LOGICAL FLAG
911 \&        IF (FLAG) VALUE = 9.4
912 \&        ...
913 \&        IF (FLAG) PRINT *, VALUE
914 \&        END
915 .Ve
916 .Sp
917 This has no bug because \f(CW\*(C`VALUE\*(C'\fR is used only if it is set.
918 .IP "\fB\-Wall\fR" 4
919 .IX Item "-Wall"
920 The \fB\-Wunused\fR and \fB\-Wuninitialized\fR options combined.
921 These are all the
922 options which pertain to usage that we recommend avoiding and that we
923 believe is easy to avoid.
924 (As more warnings are added to \fBg77\fR some might
925 be added to the list enabled by \fB\-Wall\fR.)
926 .PP
927 The remaining \fB\-W...\fR options are not implied by \fB\-Wall\fR
928 because they warn about constructions that we consider reasonable to
929 use, on occasion, in clean programs.
930 .IP "\fB\-Wsurprising\fR" 4
931 .IX Item "-Wsurprising"
932 Warn about ``suspicious'' constructs that are interpreted
933 by the compiler in a way that might well be surprising to
934 someone reading the code.
935 These differences can result in subtle, compiler-dependent
936 (even machine\-dependent) behavioral differences.
937 The constructs warned about include:
938 .RS 4
939 .IP "*" 4
940 Expressions having two arithmetic operators in a row, such
941 as \fBX*\-Y\fR.
942 Such a construct is nonstandard, and can produce
943 unexpected results in more complicated situations such
944 as \fBX**\-Y*Z\fR.
945 \&\fBg77\fR along with many other compilers, interprets
946 this example differently than many programmers, and a few
947 other compilers.
948 Specifically, \fBg77\fR interprets \fBX**\-Y*Z\fR as
949 \&\fB(X**(\-Y))*Z\fR, while others might think it should
950 be interpreted as \fBX**(\-(Y*Z))\fR.
951 .Sp
952 A revealing example is the constant expression \fB2**\-2*1.\fR,
953 which \fBg77\fR evaluates to .25, while others might evaluate
954 it to 0., the difference resulting from the way precedence affects
955 type promotion.
956 .Sp
957 (The \fB\-fpedantic\fR option also warns about expressions
958 having two arithmetic operators in a row.)
959 .IP "*" 4
960 Expressions with a unary minus followed by an operand and then
961 a binary operator other than plus or minus.
962 For example, \fB\-2**2\fR produces a warning, because
963 the precedence is \fB\-(2**2)\fR, yielding \-4, not
964 \&\fB(\-2)**2\fR, which yields 4, and which might represent
965 what a programmer expects.
966 .Sp
967 An example of an expression producing different results
968 in a surprising way is \fB\-I*S\fR, where \fII\fR holds
969 the value \fB\-2147483648\fR and \fIS\fR holds \fB0.5\fR.
970 On many systems, negating \fII\fR results in the same
971 value, not a positive number, because it is already the
972 lower bound of what an \f(CW\*(C`INTEGER(KIND=1)\*(C'\fR variable can hold.
973 So, the expression evaluates to a positive number, while
974 the ``expected'' interpretation, \fB(\-I)*S\fR, would
975 evaluate to a negative number.
976 .Sp
977 Even cases such as \fB\-I*J\fR produce warnings,
978 even though, in most configurations and situations,
979 there is no computational difference between the
980 results of the two interpretations\-\-\-the purpose
981 of this warning is to warn about differing interpretations
982 and encourage a better style of coding, not to identify
983 only those places where bugs might exist in the user's
984 code.
985 .IP "*" 4
986 \&\f(CW\*(C`DO\*(C'\fR loops with \f(CW\*(C`DO\*(C'\fR variables that are not
987 of integral type\-\-\-that is, using \f(CW\*(C`REAL\*(C'\fR
988 variables as loop control variables.
989 Although such loops can be written to work in the
990 ``obvious'' way, the way \fBg77\fR is required by the
991 Fortran standard to interpret such code is likely to
992 be quite different from the way many programmers expect.
993 (This is true of all \f(CW\*(C`DO\*(C'\fR loops, but the differences
994 are pronounced for non-integral loop control variables.)
995 .RE
996 .RS 4
997 .RE
998 .IP "\fB\-Werror\fR" 4
999 .IX Item "-Werror"
1000 Make all warnings into errors.
1001 .IP "\fB\-W\fR" 4
1002 .IX Item "-W"
1003 Turns on ``extra warnings'' and, if optimization is specified
1004 via \fB\-O\fR, the \fB\-Wuninitialized\fR option.
1005 (This might change in future versions of \fBg77\fR
1006 .Sp
1007 ``Extra warnings'' are issued for:
1008 .RS 4
1009 .IP "*" 4
1010 Unused parameters to a procedure (when \fB\-Wunused\fR also is
1011 specified).
1012 .IP "*" 4
1013 Overflows involving floating-point constants (not available
1014 for certain configurations).
1015 .RE
1016 .RS 4
1017 .RE
1018 .PP
1019 Some of these have no effect when compiling programs written in Fortran:
1020 .IP "\fB\-Wcomment\fR" 4
1021 .IX Item "-Wcomment"
1022 .PD 0
1023 .IP "\fB\-Wformat\fR" 4
1024 .IX Item "-Wformat"
1025 .IP "\fB\-Wparentheses\fR" 4
1026 .IX Item "-Wparentheses"
1027 .IP "\fB\-Wswitch\fR" 4
1028 .IX Item "-Wswitch"
1029 .IP "\fB\-Wswitch\-default\fR" 4
1030 .IX Item "-Wswitch-default"
1031 .IP "\fB\-Wswitch\-enum\fR" 4
1032 .IX Item "-Wswitch-enum"
1033 .IP "\fB\-Wtraditional\fR" 4
1034 .IX Item "-Wtraditional"
1035 .IP "\fB\-Wshadow\fR" 4
1036 .IX Item "-Wshadow"
1037 .IP "\fB\-Wid\-clash\-\fR\fIlen\fR" 4
1038 .IX Item "-Wid-clash-len"
1039 .IP "\fB\-Wlarger\-than\-\fR\fIlen\fR" 4
1040 .IX Item "-Wlarger-than-len"
1041 .IP "\fB\-Wconversion\fR" 4
1042 .IX Item "-Wconversion"
1043 .IP "\fB\-Waggregate\-return\fR" 4
1044 .IX Item "-Waggregate-return"
1045 .IP "\fB\-Wredundant\-decls\fR" 4
1046 .IX Item "-Wredundant-decls"
1047 .PD
1048 These options all could have some relevant meaning for
1049 \&\s-1GNU\s0 Fortran programs, but are not yet supported.
1050 .Sh "Options for Debugging Your Program or \s-1GNU\s0 Fortran"
1051 .IX Subsection "Options for Debugging Your Program or GNU Fortran"
1052 \&\s-1GNU\s0 Fortran has various special options that are used for debugging
1053 either your program or \fBg77\fR
1054 .IP "\fB\-g\fR" 4
1055 .IX Item "-g"
1056 Produce debugging information in the operating system's native format
1057 (stabs, \s-1COFF\s0, \s-1XCOFF\s0, or \s-1DWARF\s0).  \s-1GDB\s0 can work with this debugging
1058 information.
1059 .Sp
1060 A sample debugging session looks like this (note the use of the breakpoint):
1061 .Sp
1062 .Vb 24
1063 \&        $ cat gdb.f
1064 \&              PROGRAM PROG
1065 \&              DIMENSION A(10)
1066 \&              DATA A /1.,2.,3.,4.,5.,6.,7.,8.,9.,10./
1067 \&              A(5) = 4.
1068 \&              PRINT*,A
1069 \&              END
1070 \&        $ g77 -g -O gdb.f
1071 \&        $ gdb a.out
1072 \&        ...
1073 \&        (gdb) break MAIN__ 
1074 \&        Breakpoint 1 at 0x8048e96: file gdb.f, line 4.
1075 \&        (gdb) run
1076 \&        Starting program: /home/toon/g77-bugs/./a.out 
1077 \&        Breakpoint 1, MAIN__ () at gdb.f:4
1078 \&        4             A(5) = 4.
1079 \&        Current language:  auto; currently fortran
1080 \&        (gdb) print a(5)
1081 \&        $1 = 5
1082 \&        (gdb) step 
1083 \&        5             PRINT*,A
1084 \&        (gdb) print a(5)
1085 \&        $2 = 4
1086 \&        ...
1087 .Ve
1088 .Sp
1089 One could also add the setting of the breakpoint and the first run command
1090 to the file \fI.gdbinit\fR in the current directory, to simplify the debugging
1091 session.
1092 .Sh "Options That Control Optimization"
1093 .IX Subsection "Options That Control Optimization"
1094 Most Fortran users will want to use no optimization when
1095 developing and testing programs, and use \fB\-O\fR or \fB\-O2\fR when
1096 compiling programs for late-cycle testing and for production use.
1097 However, note that certain diagnostics\-\-\-such as for uninitialized
1098 variables\-\-\-depend on the flow analysis done by \fB\-O\fR, i.e. you
1099 must use \fB\-O\fR or \fB\-O2\fR to get such diagnostics.
1100 .PP
1101 The following flags have particular applicability when
1102 compiling Fortran programs:
1103 .IP "\fB\-malign\-double\fR" 4
1104 .IX Item "-malign-double"
1105 (Intel x86 architecture only.)
1106 .Sp
1107 Noticeably improves performance of \fBg77\fR programs making
1108 heavy use of \f(CW\*(C`REAL(KIND=2)\*(C'\fR (\f(CW\*(C`DOUBLE PRECISION\*(C'\fR) data
1109 on some systems.
1110 In particular, systems using Pentium, Pentium Pro, 586, and
1111 686 implementations
1112 of the i386 architecture execute programs faster when
1113 \&\f(CW\*(C`REAL(KIND=2)\*(C'\fR (\f(CW\*(C`DOUBLE PRECISION\*(C'\fR) data are
1114 aligned on 64\-bit boundaries
1115 in memory.
1116 .Sp
1117 This option can, at least, make benchmark results more consistent
1118 across various system configurations, versions of the program,
1119 and data sets.
1120 .Sp
1121 \&\fINote:\fR The warning in the \fBgcc\fR documentation about
1122 this option does not apply, generally speaking, to Fortran
1123 code compiled by \fBg77\fR
1124 .Sp
1125 \&\fIAlso also note:\fR The negative form of \fB\-malign\-double\fR
1126 is \fB\-mno\-align\-double\fR, not \fB\-benign\-double\fR.
1127 .IP "\fB\-ffloat\-store\fR" 4
1128 .IX Item "-ffloat-store"
1129 Might help a Fortran program that depends on exact \s-1IEEE\s0 conformance on
1130 some machines, but might slow down a program that doesn't.
1131 .Sp
1132 This option is effective when the floating-point unit is set to work in
1133 \&\s-1IEEE\s0 854 `extended precision'\-\-\-as it typically is on x86 and m68k \s-1GNU\s0
1134 systems\-\-\-rather than \s-1IEEE\s0 754 double precision.  \fB\-ffloat\-store\fR
1135 tries to remove the extra precision by spilling data from floating-point
1136 registers into memory and this typically involves a big performance
1137 hit.  However, it doesn't affect intermediate results, so that it is
1138 only partially effective.  `Excess precision' is avoided in code like:
1139 .Sp
1140 .Vb 2
1141 \&        a = b + c
1142 \&        d = a * e
1143 .Ve
1144 .Sp
1145 but not in code like:
1146 .Sp
1147 .Vb 1
1148 \&              d = (b + c) * e
1149 .Ve
1150 .Sp
1151 For another, potentially better, way of controlling the precision,
1152 see \fBFloating-point precision\fR.
1153 .IP "\fB\-fforce\-mem\fR" 4
1154 .IX Item "-fforce-mem"
1155 .PD 0
1156 .IP "\fB\-fforce\-addr\fR" 4
1157 .IX Item "-fforce-addr"
1158 .PD
1159 Might improve optimization of loops.
1160 .IP "\fB\-fno\-inline\fR" 4
1161 .IX Item "-fno-inline"
1162 Don't compile statement functions inline.
1163 Might reduce the size of a program unit\-\-\-which might be at
1164 expense of some speed (though it should compile faster).
1165 Note that if you are not optimizing, no functions can be expanded inline.
1166 .IP "\fB\-ffast\-math\fR" 4
1167 .IX Item "-ffast-math"
1168 Might allow some programs designed to not be too dependent
1169 on \s-1IEEE\s0 behavior for floating-point to run faster, or die trying.
1170 Sets \fB\-funsafe\-math\-optimizations\fR, \fB\-ffinite\-math\-only\fR,
1171 and \fB\-fno\-trapping\-math\fR.
1172 .IP "\fB\-funsafe\-math\-optimizations\fR" 4
1173 .IX Item "-funsafe-math-optimizations"
1174 Allow optimizations that may be give incorrect results
1175 for certain \s-1IEEE\s0 inputs.
1176 .IP "\fB\-ffinite\-math\-only\fR" 4
1177 .IX Item "-ffinite-math-only"
1178 Allow optimizations for floating-point arithmetic that assume
1179 that arguments and results are not NaNs or +\-Infs.
1180 .Sp
1181 This option should never be turned on by any \fB\-O\fR option since
1182 it can result in incorrect output for programs which depend on
1183 an exact implementation of \s-1IEEE\s0 or \s-1ISO\s0 rules/specifications.
1184 .Sp
1185 The default is \fB\-fno\-finite\-math\-only\fR.
1186 .IP "\fB\-fno\-trapping\-math\fR" 4
1187 .IX Item "-fno-trapping-math"
1188 Allow the compiler to assume that floating-point arithmetic
1189 will not generate traps on any inputs.  This is useful, for
1190 example, when running a program using \s-1IEEE\s0 \*(L"non\-stop\*(R"
1191 floating-point arithmetic.
1192 .IP "\fB\-fstrength\-reduce\fR" 4
1193 .IX Item "-fstrength-reduce"
1194 Might make some loops run faster.
1195 .IP "\fB\-frerun\-cse\-after\-loop\fR" 4
1196 .IX Item "-frerun-cse-after-loop"
1197 .PD 0
1198 .IP "\fB\-fexpensive\-optimizations\fR" 4
1199 .IX Item "-fexpensive-optimizations"
1200 .IP "\fB\-fdelayed\-branch\fR" 4
1201 .IX Item "-fdelayed-branch"
1202 .IP "\fB\-fschedule\-insns\fR" 4
1203 .IX Item "-fschedule-insns"
1204 .IP "\fB\-fschedule\-insns2\fR" 4
1205 .IX Item "-fschedule-insns2"
1206 .IP "\fB\-fcaller\-saves\fR" 4
1207 .IX Item "-fcaller-saves"
1208 .PD
1209 Might improve performance on some code.
1210 .IP "\fB\-funroll\-loops\fR" 4
1211 .IX Item "-funroll-loops"
1212 Typically improves performance on code using iterative \f(CW\*(C`DO\*(C'\fR loops by
1213 unrolling them and is probably generally appropriate for Fortran, though
1214 it is not turned on at any optimization level.
1215 Note that outer loop unrolling isn't done specifically; decisions about
1216 whether to unroll a loop are made on the basis of its instruction count.
1217 .Sp
1218 Also, no `loop discovery'[1] is done, so only loops written with \f(CW\*(C`DO\*(C'\fR
1219 benefit from loop optimizations, including\-\-\-but not limited
1220 to\-\-\-unrolling.  Loops written with \f(CW\*(C`IF\*(C'\fR and \f(CW\*(C`GOTO\*(C'\fR are not
1221 currently recognized as such.  This option unrolls only iterative
1222 \&\f(CW\*(C`DO\*(C'\fR loops, not \f(CW\*(C`DO WHILE\*(C'\fR loops.
1223 .IP "\fB\-funroll\-all\-loops\fR" 4
1224 .IX Item "-funroll-all-loops"
1225 Probably improves performance on code using \f(CW\*(C`DO WHILE\*(C'\fR loops by
1226 unrolling them in addition to iterative \f(CW\*(C`DO\*(C'\fR loops.  In the absence
1227 of \f(CW\*(C`DO WHILE\*(C'\fR, this option is equivalent to \fB\-funroll\-loops\fR
1228 but possibly slower.
1229 .IP "\fB\-fno\-move\-all\-movables\fR" 4
1230 .IX Item "-fno-move-all-movables"
1231 .PD 0
1232 .IP "\fB\-fno\-reduce\-all\-givs\fR" 4
1233 .IX Item "-fno-reduce-all-givs"
1234 .IP "\fB\-fno\-rerun\-loop\-opt\fR" 4
1235 .IX Item "-fno-rerun-loop-opt"
1236 .PD
1237 In general, the optimizations enabled with these options will lead to
1238 faster code being generated by \s-1GNU\s0 Fortran; hence they are enabled by default
1239 when issuing the \fBg77\fR command.
1240 .Sp
1241 \&\fB\-fmove\-all\-movables\fR and \fB\-freduce\-all\-givs\fR will enable
1242 loop optimization to move all loop-invariant index computations in nested
1243 loops over multi-rank array dummy arguments out of these loops.
1244 .Sp
1245 \&\fB\-frerun\-loop\-opt\fR will move offset calculations resulting
1246 from the fact that Fortran arrays by default have a lower bound of 1
1247 out of the loops.
1248 .Sp
1249 These three options are intended to be removed someday, once
1250 loop optimization is sufficiently advanced to perform all those
1251 transformations without help from these options.
1252 .Sh "Options Controlling the Preprocessor"
1253 .IX Subsection "Options Controlling the Preprocessor"
1254 These options control the C preprocessor, which is run on each C source
1255 file before actual compilation.
1256 .PP
1257 Some of these options also affect how \fBg77\fR processes the
1258 \&\f(CW\*(C`INCLUDE\*(C'\fR directive.
1259 Since this directive is processed even when preprocessing
1260 is not requested, it is not described in this section.
1261 .PP
1262 However, the \f(CW\*(C`INCLUDE\*(C'\fR directive does not apply
1263 preprocessing to the contents of the included file itself.
1264 .PP
1265 Therefore, any file that contains preprocessor directives
1266 (such as \f(CW\*(C`#include\*(C'\fR, \f(CW\*(C`#define\*(C'\fR, and \f(CW\*(C`#if\*(C'\fR)
1267 must be included via the \f(CW\*(C`#include\*(C'\fR directive, not
1268 via the \f(CW\*(C`INCLUDE\*(C'\fR directive.
1269 Therefore, any file containing preprocessor directives,
1270 if included, is necessarily included by a file that itself
1271 contains preprocessor directives.
1272 .Sh "Options for Directory Search"
1273 .IX Subsection "Options for Directory Search"
1274 These options affect how the \fBcpp\fR preprocessor searches
1275 for files specified via the \f(CW\*(C`#include\*(C'\fR directive.
1276 Therefore, when compiling Fortran programs, they are meaningful
1277 when the preprocessor is used.
1278 .PP
1279 Some of these options also affect how \fBg77\fR searches
1280 for files specified via the \f(CW\*(C`INCLUDE\*(C'\fR directive,
1281 although files included by that directive are not,
1282 themselves, preprocessed.
1283 These options are:
1284 .IP "\fB\-I\-\fR" 4
1285 .IX Item "-I-"
1286 .PD 0
1287 .IP "\fB\-I\fR\fIdir\fR" 4
1288 .IX Item "-Idir"
1289 .PD
1290 These affect interpretation of the \f(CW\*(C`INCLUDE\*(C'\fR directive
1291 (as well as of the \f(CW\*(C`#include\*(C'\fR directive of the \fBcpp\fR
1292 preprocessor).
1293 .Sp
1294 Note that \fB\-I\fR\fIdir\fR must be specified \fIwithout\fR any
1295 spaces between \fB\-I\fR and the directory name\-\-\-that is,
1296 \&\fB\-Ifoo/bar\fR is valid, but \fB\-I foo/bar\fR
1297 is rejected by the \fBg77\fR compiler (though the preprocessor supports
1298 the latter form).
1299 Also note that the general behavior of \fB\-I\fR and
1300 \&\f(CW\*(C`INCLUDE\*(C'\fR is pretty much the same as of \fB\-I\fR with
1301 \&\f(CW\*(C`#include\*(C'\fR in the \fBcpp\fR preprocessor, with regard to
1302 looking for \fIheader.gcc\fR files and other such things.
1303 .Sh "Options for Code Generation Conventions"
1304 .IX Subsection "Options for Code Generation Conventions"
1305 These machine-independent options control the interface conventions
1306 used in code generation.
1307 .PP
1308 Most of them have both positive and negative forms; the negative form
1309 of \fB\-ffoo\fR would be \fB\-fno\-foo\fR.  In the table below, only
1310 one of the forms is listed\-\-\-the one which is not the default.  You
1311 can figure out the other form by either removing \fBno\-\fR or adding
1312 it.
1313 .IP "\fB\-fno\-automatic\fR" 4
1314 .IX Item "-fno-automatic"
1315 Treat each program unit as if the \f(CW\*(C`SAVE\*(C'\fR statement was specified
1316 for every local variable and array referenced in it.
1317 Does not affect common blocks.
1318 (Some Fortran compilers provide this option under
1319 the name \fB\-static\fR.)
1320 .IP "\fB\-finit\-local\-zero\fR" 4
1321 .IX Item "-finit-local-zero"
1322 Specify that variables and arrays that are local to a program unit
1323 (not in a common block and not passed as an argument) are to be initialized
1324 to binary zeros.
1325 .Sp
1326 Since there is a run-time penalty for initialization of variables
1327 that are not given the \f(CW\*(C`SAVE\*(C'\fR attribute, it might be a
1328 good idea to also use \fB\-fno\-automatic\fR with \fB\-finit\-local\-zero\fR.
1329 .IP "\fB\-fno\-f2c\fR" 4
1330 .IX Item "-fno-f2c"
1331 Do not generate code designed to be compatible with code generated
1332 by \fBf2c\fR use the \s-1GNU\s0 calling conventions instead.
1333 .Sp
1334 The \fBf2c\fR calling conventions require functions that return
1335 type \f(CW\*(C`REAL(KIND=1)\*(C'\fR to actually return the C type \f(CW\*(C`double\*(C'\fR,
1336 and functions that return type \f(CW\*(C`COMPLEX\*(C'\fR to return the
1337 values via an extra argument in the calling sequence that points
1338 to where to store the return value.
1339 Under the \s-1GNU\s0 calling conventions, such functions simply return
1340 their results as they would in \s-1GNU\s0 C\-\-\-\f(CW\*(C`REAL(KIND=1)\*(C'\fR functions
1341 return the C type \f(CW\*(C`float\*(C'\fR, and \f(CW\*(C`COMPLEX\*(C'\fR functions
1342 return the \s-1GNU\s0 C type \f(CW\*(C`complex\*(C'\fR (or its \f(CW\*(C`struct\*(C'\fR
1343 equivalent).
1344 .Sp
1345 This does not affect the generation of code that interfaces with the
1346 \&\f(CW\*(C`libg2c\*(C'\fR library.
1347 .Sp
1348 However, because the \f(CW\*(C`libg2c\*(C'\fR library uses \fBf2c\fR
1349 calling conventions, \fBg77\fR rejects attempts to pass
1350 intrinsics implemented by routines in this library as actual
1351 arguments when \fB\-fno\-f2c\fR is used, to avoid bugs when
1352 they are actually called by code expecting the \s-1GNU\s0 calling
1353 conventions to work.
1354 .Sp
1355 For example, \fB\s-1INTRINSIC\s0 \s-1ABS\s0;CALL \s-1FOO\s0(\s-1ABS\s0)\fR is
1356 rejected when \fB\-fno\-f2c\fR is in force.
1357 (Future versions of the \fBg77\fR run-time library might
1358 offer routines that provide GNU-callable versions of the
1359 routines that implement the \fBf2c\fR intrinsics
1360 that may be passed as actual arguments, so that
1361 valid programs need not be rejected when \fB\-fno\-f2c\fR
1362 is used.)
1363 .Sp
1364 \&\fBCaution:\fR If \fB\-fno\-f2c\fR is used when compiling any
1365 source file used in a program, it must be used when compiling
1366 \&\fIall\fR Fortran source files used in that program.
1367 .IP "\fB\-ff2c\-library\fR" 4
1368 .IX Item "-ff2c-library"
1369 Specify that use of \f(CW\*(C`libg2c\*(C'\fR (or the original \f(CW\*(C`libf2c\*(C'\fR)
1370 is required.
1371 This is the default for the current version of \fBg77\fR
1372 .Sp
1373 Currently it is not
1374 valid to specify \fB\-fno\-f2c\-library\fR.
1375 This option is provided so users can specify it in shell
1376 scripts that build programs and libraries that require the
1377 \&\f(CW\*(C`libf2c\*(C'\fR library, even when being compiled by future
1378 versions of \fBg77\fR that might otherwise default to
1379 generating code for an incompatible library.
1380 .IP "\fB\-fno\-underscoring\fR" 4
1381 .IX Item "-fno-underscoring"
1382 Do not transform names of entities specified in the Fortran
1383 source file by appending underscores to them.
1384 .Sp
1385 With \fB\-funderscoring\fR in effect, \fBg77\fR appends two underscores
1386 to names with underscores and one underscore to external names with
1387 no underscores.  (\fBg77\fR also appends two underscores to internal
1388 names with underscores to avoid naming collisions with external names.
1389 The \fB\-fno\-second\-underscore\fR option disables appending of the
1390 second underscore in all cases.)
1391 .Sp
1392 This is done to ensure compatibility with code produced by many
1393 \&\s-1UNIX\s0 Fortran compilers, including \fBf2c\fR which perform the
1394 same transformations.
1395 .Sp
1396 Use of \fB\-fno\-underscoring\fR is not recommended unless you are
1397 experimenting with issues such as integration of (\s-1GNU\s0) Fortran into
1398 existing system environments (vis\-a\-vis existing libraries, tools, and
1399 so on).
1400 .Sp
1401 For example, with \fB\-funderscoring\fR, and assuming other defaults like
1402 \&\fB\-fcase\-lower\fR and that \fBj()\fR and \fB\f(BImax_count()\fB\fR are
1403 external functions while \fBmy_var\fR and \fBlvar\fR are local variables,
1404 a statement like
1405 .Sp
1406 .Vb 1
1407 \&        I = J() + MAX_COUNT (MY_VAR, LVAR)
1408 .Ve
1409 .Sp
1410 is implemented as something akin to:
1411 .Sp
1412 .Vb 1
1413 \&        i = j_() + max_count__(&my_var__, &lvar);
1414 .Ve
1415 .Sp
1416 With \fB\-fno\-underscoring\fR, the same statement is implemented as:
1417 .Sp
1418 .Vb 1
1419 \&        i = j() + max_count(&my_var, &lvar);
1420 .Ve
1421 .Sp
1422 Use of \fB\-fno\-underscoring\fR allows direct specification of
1423 user-defined names while debugging and when interfacing \fBg77\fR
1424 code with other languages.
1425 .Sp
1426 Note that just because the names match does \fInot\fR mean that the
1427 interface implemented by \fBg77\fR for an external name matches the
1428 interface implemented by some other language for that same name.
1429 That is, getting code produced by \fBg77\fR to link to code produced
1430 by some other compiler using this or any other method can be only a
1431 small part of the overall solution\-\-\-getting the code generated by
1432 both compilers to agree on issues other than naming can require
1433 significant effort, and, unlike naming disagreements, linkers normally
1434 cannot detect disagreements in these other areas.
1435 .Sp
1436 Also, note that with \fB\-fno\-underscoring\fR, the lack of appended
1437 underscores introduces the very real possibility that a user-defined
1438 external name will conflict with a name in a system library, which
1439 could make finding unresolved-reference bugs quite difficult in some
1440 cases\-\-\-they might occur at program run time, and show up only as
1441 buggy behavior at run time.
1442 .Sp
1443 In future versions of \fBg77\fR we hope to improve naming and linking
1444 issues so that debugging always involves using the names as they appear
1445 in the source, even if the names as seen by the linker are mangled to
1446 prevent accidental linking between procedures with incompatible
1447 interfaces.
1448 .IP "\fB\-fno\-second\-underscore\fR" 4
1449 .IX Item "-fno-second-underscore"
1450 Do not append a second underscore to names of entities specified
1451 in the Fortran source file.
1452 .Sp
1453 This option has no effect if \fB\-fno\-underscoring\fR is
1454 in effect.
1455 .Sp
1456 Otherwise, with this option, an external name such as \fB\s-1MAX_COUNT\s0\fR
1457 is implemented as a reference to the link-time external symbol
1458 \&\fBmax_count_\fR, instead of \fBmax_count_\|_\fR.
1459 .IP "\fB\-fno\-ident\fR" 4
1460 .IX Item "-fno-ident"
1461 Ignore the \fB#ident\fR directive.
1462 .IP "\fB\-fzeros\fR" 4
1463 .IX Item "-fzeros"
1464 Treat initial values of zero as if they were any other value.
1465 .Sp
1466 As of version 0.5.18, \fBg77\fR normally treats \f(CW\*(C`DATA\*(C'\fR and
1467 other statements that are used to specify initial values of zero
1468 for variables and arrays as if no values were actually specified,
1469 in the sense that no diagnostics regarding multiple initializations
1470 are produced.
1471 .Sp
1472 This is done to speed up compiling of programs that initialize
1473 large arrays to zeros.
1474 .Sp
1475 Use \fB\-fzeros\fR to revert to the simpler, slower behavior
1476 that can catch multiple initializations by keeping track of
1477 all initializations, zero or otherwise.
1478 .Sp
1479 \&\fICaution:\fR Future versions of \fBg77\fR might disregard this option
1480 (and its negative form, the default) or interpret it somewhat
1481 differently.
1482 The interpretation changes will affect only non-standard
1483 programs; standard-conforming programs should not be affected.
1484 .IP "\fB\-femulate\-complex\fR" 4
1485 .IX Item "-femulate-complex"
1486 Implement \f(CW\*(C`COMPLEX\*(C'\fR arithmetic via emulation,
1487 instead of using the facilities of
1488 the \fBgcc\fR back end that provide direct support of
1489 \&\f(CW\*(C`complex\*(C'\fR arithmetic.
1490 .Sp
1491 (\fBgcc\fR had some bugs in its back-end support
1492 for \f(CW\*(C`complex\*(C'\fR arithmetic, due primarily to the support not being
1493 completed as of version 2.8.1 and \f(CW\*(C`egcs\*(C'\fR 1.1.2.)
1494 .Sp
1495 Use \fB\-femulate\-complex\fR if you suspect code-generation bugs,
1496 or experience compiler crashes,
1497 that might result from \fBg77\fR using the \f(CW\*(C`COMPLEX\*(C'\fR support
1498 in the \fBgcc\fR back end.
1499 If using that option fixes the bugs or crashes you are seeing,
1500 that indicates a likely \fBg77\fR bugs
1501 (though, all compiler crashes are considered bugs),
1502 so, please report it.
1503 (Note that the known bugs, now believed fixed, produced compiler crashes
1504 rather than causing the generation of incorrect code.)
1505 .Sp
1506 Use of this option should not affect how Fortran code compiled
1507 by \fBg77\fR works in terms of its interfaces to other code,
1508 e.g. that compiled by \fBf2c\fR
1509 .Sp
1510 As of \s-1GCC\s0 version 3.0, this option is not necessary anymore.
1511 .Sp
1512 \&\fICaution:\fR Future versions of \fBg77\fR might ignore both forms
1513 of this option.
1514 .IP "\fB\-falias\-check\fR" 4
1515 .IX Item "-falias-check"
1516 .PD 0
1517 .IP "\fB\-fargument\-alias\fR" 4
1518 .IX Item "-fargument-alias"
1519 .IP "\fB\-fargument\-noalias\fR" 4
1520 .IX Item "-fargument-noalias"
1521 .IP "\fB\-fno\-argument\-noalias\-global\fR" 4
1522 .IX Item "-fno-argument-noalias-global"
1523 .PD
1524 \&\fIVersion info:\fR
1525 These options are not supported by
1526 versions of \fBg77\fR based on \fBgcc\fR version 2.8.
1527 .Sp
1528 These options specify to what degree aliasing
1529 (overlap)
1530 is permitted between
1531 arguments (passed as pointers) and \f(CW\*(C`COMMON\*(C'\fR (external, or
1532 public) storage.
1533 .Sp
1534 The default for Fortran code, as mandated by the \s-1FORTRAN\s0 77 and
1535 Fortran 90 standards, is \fB\-fargument\-noalias\-global\fR.
1536 The default for code written in the C language family is
1537 \&\fB\-fargument\-alias\fR.
1538 .Sp
1539 Note that, on some systems, compiling with \fB\-fforce\-addr\fR in
1540 effect can produce more optimal code when the default aliasing
1541 options are in effect (and when optimization is enabled).
1542 .IP "\fB\-fno\-globals\fR" 4
1543 .IX Item "-fno-globals"
1544 Disable diagnostics about inter-procedural
1545 analysis problems, such as disagreements about the
1546 type of a function or a procedure's argument,
1547 that might cause a compiler crash when attempting
1548 to inline a reference to a procedure within a
1549 program unit.
1550 (The diagnostics themselves are still produced, but
1551 as warnings, unless \fB\-Wno\-globals\fR is specified,
1552 in which case no relevant diagnostics are produced.)
1553 .Sp
1554 Further, this option disables such inlining, to
1555 avoid compiler crashes resulting from incorrect
1556 code that would otherwise be diagnosed.
1557 .Sp
1558 As such, this option might be quite useful when
1559 compiling existing, ``working'' code that happens
1560 to have a few bugs that do not generally show themselves,
1561 but which \fBg77\fR diagnoses.
1562 .Sp
1563 Use of this option therefore has the effect of
1564 instructing \fBg77\fR to behave more like it did
1565 up through version 0.5.19.1, when it paid little or
1566 no attention to disagreements between program units
1567 about a procedure's type and argument information,
1568 and when it performed no inlining of procedures
1569 (except statement functions).
1570 .Sp
1571 Without this option, \fBg77\fR defaults to performing
1572 the potentially inlining procedures as it started doing
1573 in version 0.5.20, but as of version 0.5.21, it also
1574 diagnoses disagreements that might cause such inlining
1575 to crash the compiler as (fatal) errors,
1576 and warns about similar disagreements
1577 that are currently believed to not
1578 likely to result in the compiler later crashing
1579 or producing incorrect code.
1580 .IP "\fB\-fflatten\-arrays\fR" 4
1581 .IX Item "-fflatten-arrays"
1582 Use back end's C\-like constructs
1583 (pointer plus offset)
1584 instead of its \f(CW\*(C`ARRAY_REF\*(C'\fR construct
1585 to handle all array references.
1586 .Sp
1587 \&\fINote:\fR This option is not supported.
1588 It is intended for use only by \fBg77\fR developers,
1589 to evaluate code-generation issues.
1590 It might be removed at any time.
1591 .IP "\fB\-fbounds\-check\fR" 4
1592 .IX Item "-fbounds-check"
1593 .PD 0
1594 .IP "\fB\-ffortran\-bounds\-check\fR" 4
1595 .IX Item "-ffortran-bounds-check"
1596 .PD
1597 Enable generation of run-time checks for array subscripts
1598 and substring start and end points
1599 against the (locally) declared minimum and maximum values.
1600 .Sp
1601 The current implementation uses the \f(CW\*(C`libf2c\*(C'\fR
1602 library routine \f(CW\*(C`s_rnge\*(C'\fR to print the diagnostic.
1603 .Sp
1604 However, whereas \fBf2c\fR generates a single check per
1605 reference for a multi-dimensional array, of the computed
1606 offset against the valid offset range (0 through the size of the array),
1607 \&\fBg77\fR generates a single check per \fIsubscript\fR expression.
1608 This catches some cases of potential bugs that \fBf2c\fR does not,
1609 such as references to below the beginning of an assumed-size array.
1610 .Sp
1611 \&\fBg77\fR also generates checks for \f(CW\*(C`CHARACTER\*(C'\fR substring references,
1612 something \fBf2c\fR currently does not do.
1613 .Sp
1614 Use the new \fB\-ffortran\-bounds\-check\fR option
1615 to specify bounds-checking for only the Fortran code you are compiling,
1616 not necessarily for code written in other languages.
1617 .Sp
1618 \&\fINote:\fR To provide more detailed information on the offending subscript,
1619 \&\fBg77\fR provides the \f(CW\*(C`libg2c\*(C'\fR run-time library routine \f(CW\*(C`s_rnge\*(C'\fR
1620 with somewhat differently-formatted information.
1621 Here's a sample diagnostic:
1622 .Sp
1623 .Vb 3
1624 \&        Subscript out of range on file line 4, procedure rnge.f/bf.
1625 \&        Attempt to access the -6-th element of variable b[subscript-2-of-2].
1626 \&        Aborted
1627 .Ve
1628 .Sp
1629 The above message indicates that the offending source line is
1630 line 4 of the file \fIrnge.f\fR,
1631 within the program unit (or statement function) named \fBbf\fR.
1632 The offended array is named \fBb\fR.
1633 The offended array dimension is the second for a two-dimensional array,
1634 and the offending, computed subscript expression was \fB\-6\fR.
1635 .Sp
1636 For a \f(CW\*(C`CHARACTER\*(C'\fR substring reference, the second line has
1637 this appearance:
1638 .Sp
1639 .Vb 1
1640 \&        Attempt to access the 11-th element of variable a[start-substring].
1641 .Ve
1642 .Sp
1643 This indicates that the offended \f(CW\*(C`CHARACTER\*(C'\fR variable or array
1644 is named \fBa\fR,
1645 the offended substring position is the starting (leftmost) position,
1646 and the offending substring expression is \fB11\fR.
1647 .Sp
1648 (Though the verbage of \f(CW\*(C`s_rnge\*(C'\fR is not ideal
1649 for the purpose of the \fBg77\fR compiler,
1650 the above information should provide adequate diagnostic abilities
1651 to it users.)
1652 .PP
1653 Some of these do \fInot\fR work when compiling programs written in Fortran:
1654 .IP "\fB\-fpcc\-struct\-return\fR" 4
1655 .IX Item "-fpcc-struct-return"
1656 .PD 0
1657 .IP "\fB\-freg\-struct\-return\fR" 4
1658 .IX Item "-freg-struct-return"
1659 .PD
1660 You should not use these except strictly the same way as you
1661 used them to build the version of \f(CW\*(C`libg2c\*(C'\fR with which
1662 you will be linking all code compiled by \fBg77\fR with the
1663 same option.
1664 .IP "\fB\-fshort\-double\fR" 4
1665 .IX Item "-fshort-double"
1666 This probably either has no effect on Fortran programs, or
1667 makes them act loopy.
1668 .IP "\fB\-fno\-common\fR" 4
1669 .IX Item "-fno-common"
1670 Do not use this when compiling Fortran programs,
1671 or there will be Trouble.
1672 .IP "\fB\-fpack\-struct\fR" 4
1673 .IX Item "-fpack-struct"
1674 This probably will break any calls to the \f(CW\*(C`libg2c\*(C'\fR library,
1675 at the very least, even if it is built with the same option.
1676 .SH "ENVIRONMENT"
1677 .IX Header "ENVIRONMENT"
1678 \&\s-1GNU\s0 Fortran currently does not make use of any environment
1679 variables to control its operation above and beyond those
1680 that affect the operation of \fBgcc\fR.
1681 .SH "BUGS"
1682 .IX Header "BUGS"
1683 For instructions on reporting bugs, see
1684 <\fBhttp://gcc.gnu.org/bugs.html\fR>.  Use of the \fBgccbug\fR  
1685 script to report bugs is recommended.
1686 .SH "FOOTNOTES"
1687 .IX Header "FOOTNOTES"
1688 .IP "1." 4
1689 \&\fIloop discovery\fR refers to the
1690 process by which a compiler, or indeed any reader of a program,
1691 determines which portions of the program are more likely to be executed
1692 repeatedly as it is being run.  Such discovery typically is done early
1693 when compiling using optimization techniques, so the ``discovered''
1694 loops get more attention\-\-\-and more run-time resources, such as
1695 registers\-\-\-from the compiler.  It is easy to ``discover'' loops that are
1696 constructed out of looping constructs in the language
1697 (such as Fortran's \f(CW\*(C`DO\*(C'\fR).  For some programs, ``discovering'' loops
1698 constructed out of lower-level constructs (such as \f(CW\*(C`IF\*(C'\fR and
1699 \&\f(CW\*(C`GOTO\*(C'\fR) can lead to generation of more optimal code
1700 than otherwise.
1701 .SH "SEE ALSO"
1702 .IX Header "SEE ALSO"
1703 \&\fIgpl\fR\|(7), \fIgfdl\fR\|(7), \fIfsf\-funding\fR\|(7),
1704 \&\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)
1705 and the Info entries for \fIgcc\fR, \fIcpp\fR, \fIg77\fR, \fIas\fR,
1706 \&\fIld\fR, \fIbinutils\fR and \fIgdb\fR.
1707 .SH "AUTHOR"
1708 .IX Header "AUTHOR"
1709 See the Info entry for \fBg77\fR for contributors to \s-1GCC\s0 and G77.
1710 .SH "COPYRIGHT"
1711 .IX Header "COPYRIGHT"
1712 Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004
1713 Free Software Foundation, Inc.
1714 .PP
1715 Permission is granted to copy, distribute and/or modify this document
1716 under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.2 or
1717 any later version published by the Free Software Foundation; with the
1718 Invariant Sections being ``\s-1GNU\s0 General Public License'' and ``Funding
1719 Free Software'', the Front-Cover texts being (a) (see below), and with
1720 the Back-Cover Texts being (b) (see below).  A copy of the license is
1721 included in the \fIgfdl\fR\|(7) man page.
1722 .PP
1723 (a) The \s-1FSF\s0's Front-Cover Text is:
1724 .PP
1725 .Vb 1
1726 \&     A GNU Manual
1727 .Ve
1728 .PP
1729 (b) The \s-1FSF\s0's Back-Cover Text is:
1730 .PP
1731 .Vb 3
1732 \&     You have freedom to copy and modify this GNU Manual, like GNU
1733 \&     software.  Copies published by the Free Software Foundation raise
1734 \&     funds for GNU development.
1735 .Ve