|
|
1.1 root 1: .\" Copyright (c) 1991 Free Software Foundation -*-Text-*-
2: .\" See section COPYING for conditions for redistribution
3: .\" FIXME: no info here on predefines. Should there be? extra for C++...
4: .TH GCC 1 "27dec1991" "GNU Tools" "GNU Tools"
5: .de BP
6: .sp
7: .ti \-.2i
8: \(**
9: ..
10: .SH NAME
11: gcc, g++ \- GNU project C and C++ Compiler (v2 preliminary)
12: .SH SYNOPSIS
13: .RB gcc " [" \c
14: .IR option " | " filename " ].\|.\|.
15: .br
16: .RB g++ " [" \c
17: .IR option " | " filename " ].\|.\|.
18: .SH WARNING
19: The information in this man page is an extract from the full
20: documentation of the GNU C compiler, and is limited to the meaning of
21: the options.
22:
23: For complete, current documentation, refer to the Info file `\|\c
24: .B gcc\c
25: \&\|' or the manual
26: .I
27: Using and Porting GNU CC (for version 2.0)\c
28: \&. Both are made from the Texinfo source file
29: .BR gcc.texinfo .
30: .SH DESCRIPTION
31: The C and C++ compilers are integrated. Both process input files
32: through one or more of four stages: preprocessing, compilation,
33: assembly, and linking. Source filename suffixes identify the source
34: language, but which name you use for the compiler governs default
35: assumptions:
36: .TP
37: .B gcc
38: assumes preprocessed (\c
39: .B .i\c
40: \&) files are C and assumes C style linking.
41: .TP
42: .B g++
43: assumes preprocessed (\c
44: .B .i\c
45: \&) files are C++ and assumes C++ style linking.
46: .PP
47: Suffixes of source file names indicate the language and kind of
48: processing to be done:
49:
50: .ta \w'.cxx 'u
51: .B .c\c
52: \& C source; preprocess, compile, assemble
53: .br
54: .B .C\c
55: \& C++ source; preprocess, compile, assemble
56: .br
57: .B .cc\c
58: \& C++ source; preprocess, compile, assemble
59: .br
60: .B .cxx\c
61: \& C++ source; preprocess, compile, assemble
62: .br
63: .B .m\c
64: \& Objective-C source; preprocess, compile, assemble
65: .br
66: .B .i\c
67: \& preprocessed C or C++; compile, assemble
68: .br
69: .B .s\c
70: \& Assembler source; assemble
71: .br
72: .B .S\c
73: \& Assembler source; preprocess, assemble
74: .br
75: .B .h\c
76: \& Preprocessor file; not usually named on command line
77:
78: .I ??\c
79: \& Other (unrecognized) files passed to linker.
80: .br
81: \& Common cases:
82: .br
83: .B .o\c
84: \& Object file
85: .br
86: .B .a\c
87: \& Archive file
88:
89: Linking is always the last stage unless you use one of the
90: .BR \-c ,
91: .BR \-S ,
92: or
93: .B \-E
94: options to avoid it (or unless compilation errors stop the whole
95: process). For the link stage, all
96: .B .o
97: files corresponding to source files,
98: .B \-l
99: libraries, unrecognized filenames (including named
100: .B .o
101: object files and
102: .B .a
103: archives)
104: are passed to the linker in command-line order.
105:
106: .SH OPTIONS
107: Options must be separate: `\|\c
108: .B \-dr\c
109: \&\|' is quite different from `\|\c
110: .B \-d \-r
111: \&\|'.
112:
113: Most `\|\c
114: .B \-f\c
115: \&\|' and `\|\c
116: .B \-W\c
117: \&\|' options have two contrary forms:
118: .BI \-f name
119: and
120: .BI \-fno\- name\c
121: \& (or
122: .BI \-W name
123: and
124: .BI \-Wno\- name\c
125: \&). Only the non-default forms are shown here.
126:
127: Here is a summary of all the options, grouped by type. Explanations are
128: in the following sections.
129:
130: .hy 0
131: .na
132: .TP
133: .B Overall Options
134: .br
135: \-c
136: \-S
137: \-E
138: .RI "\-o " file
139: \-pipe
140: \-v
141: \-vpath
142: \-vspec
143: .RI "\-x " language
144:
145: .TP
146: .B Language Options
147: \-ansi
148: \-fall\-virtual
149: \-fcond\-mismatch
150: \-fdollars\-in\-identifiers
151: \-fenum\-int\-equiv
152: \-fno\-asm
153: \-fno\-builtin
154: \-fno\-strict\-prototype
155: \-fsigned\-bitfields
156: \-fsigned\-char
157: \-fthis\-is\-variable
158: \-funsigned\-bitfields
159: \-funsigned\-char
160: \-fwritable\-strings
161: \-traditional
162: \-traditional\-cpp
163: \-trigraphs
164:
165: .TP
166: .B Warning Options
167: \-fsyntax\-only
168: \-pedantic
169: \-pedantic\-errors
170: \-w
171: \-W
172: \-Wall
173: \-Waggregate\-return
174: \-Wcast\-align
175: \-Wcast\-qual
176: \-Wcomment
177: \-Wconversion
178: \-Wenum\-clash
179: \-Werror
180: \-Wformat
181: .RI \-Wid\-clash\- len
182: \-Wimplicit
183: \-Wmissing\-prototypes
184: \-Wno\-parentheses
185: \-Wpointer\-arith
186: \-Wreturn\-type
187: \-Wshadow
188: \-Wstrict\-prototypes
189: \-Wswitch
190: \-Wtraditional
191: \-Wtrigraphs
192: \-Wuninitialized
193: \-Wunused
194: \-Wwrite\-strings
195:
196: .TP
197: .B Debugging Options
198: \-a
199: .RI \-d letters
200: \-fpretend\-float
201: \-g
202: \-gdbx
203: \-gdwarf
204: \-ggdb
205: \-gsdb
206: \-p
207: \-pg
208: \-save\-temps
209:
210: .TP
211: .B Optimization Options
212: \-fcaller\-saves
213: \-fcse\-follow\-jumps
214: \-fdelayed\-branch
215: \-felide\-constructors
216: \-fexpensive\-optimizations
217: \-ffloat\-store
218: \-fforce\-addr
219: \-fforce\-mem
220: \-finline
221: \-finline\-functions
222: \-fkeep\-inline\-functions
223: \-fmemoize\-lookups
224: \-fno\-default\-inline
225: \-fno\-defer\-pop
226: \-fno\-function\-cse
227: \-fomit\-frame\-pointer
228: \-frerun\-cse\-after\-loop
229: \-fschedule\-insns
230: \-fschedule\-insns2
231: \-fstrength\-reduce
232: \-fthread\-jumps
233: \-funroll\-all\-loops
234: \-funroll\-loops
235: \-O
236: \-O2
237:
238: .TP
239: .B Preprocessor Options
240: \-C
241: \-dD
242: \-dM
243: \-dN
244: .RI \-D macro [\|= defn \|]
245: \-E
246: \-H
247: .RI "\-i " file
248: \-M
249: \-MD
250: \-MM
251: \-MMD
252: \-nostdinc
253: \-P
254: .RI \-U macro
255: \-undef
256:
257: .TP
258: .B Linker Options
259: \-dynamic
260: .RI \-l library
261: \-nostdlib
262: \-static
263:
264: .TP
265: .B Directory Options
266: .RI \-B prefix
267: .RI \-I dir
268: \-I\-
269: .RI \-L dir
270:
271: .TP
272: .B Target Options
273: .RI "\-b " machine
274: .RI "\-V " version
275:
276: .TP
277: .B Machine Dependent Options
278: .I M680x0\ Options
279: .br
280: \-m68000
281: \-m68020
282: \-m68881
283: \-mbitfield
284: \-mc68000
285: \-mc68020
286: \-mfpa
287: \-mnobitfield
288: \-mrtd
289: \-mshort
290: \-msoft\-float
291:
292: .I VAX Options
293: .br
294: \-mg
295: \-mgnu
296: \-munix
297:
298: .I SPARC Options
299: .br
300: \-mfpu
301: \-mno\-epilogue
302:
303: .I Convex Options
304: .br
305: \-margcount
306: \-mc1
307: \-mc2
308: \-mnoargcount
309:
310: .I AMD29K Options
311: .br
312: \-m29000
313: \-m29050
314: \-mbw
315: \-mdw
316: \-mkernel\-registers
317: \-mlarge
318: \-mnbw
319: \-mnodw
320: \-msmall
321: \-mstack\-check
322: \-muser\-registers
323:
324: .I M88K Options
325: .br
326: \-mbig\-pic
327: \-mcheck\-zero\-division
328: \-mhandle\-large\-shift
329: \-midentify\-revision
330: \-mno\-check\-zero\-division
331: \-mno\-ocs\-debug\-info
332: \-mno\-ocs\-frame\-position
333: \-mno\-optimize\-arg\-area
334: \-mno\-underscores
335: \-mocs\-debug\-info
336: \-mocs\-frame\-position
337: \-moptimize\-arg\-area
338: .RI \-mshort\-data\- num
339: \-msvr3
340: \-msvr4
341: \-mtrap\-large\-shift
342: \-muse\-div\-instruction
343: \-mversion\-03.00
344: \-mwarn\-passed\-structs
345:
346: .I RS6000 Options
347: .br
348: \-mfp\-in\-toc
349: \-mno\-fop\-in\-toc
350:
351: .I RT Options
352: .br
353: \-mcall\-lib\-mul
354: \-mfp\-arg\-in\-fpregs
355: \-mfp\-arg\-in\-gregs
356: \-mfull\-fp\-blocks
357: \-mhc\-struct\-return
358: \-min\-line\-mul
359: \-mminimum\-fp\-blocks
360: \-mnohc\-struct\-return
361:
362: .I MIPS Options
363: .br
364: \-mcpu=\fIcpu type\fP
365: \-mips2
366: \-mips3
367: \-mint64
368: \-mlong64
369: \-mlonglong128
370: \-mmips\-as
371: \-mgas
372: \-mrnames
373: \-mno\-rnames
374: \-mgpopt
375: \-mno\-gpopt
376: \-mstats
377: \-mno\-stats
378: \-mmemcpy
379: \-mno\-memcpy
380: \-mno\-mips\-tfile
381: \-mmips\-tfile
382: \-msoft\-float
383: \-mhard\-float
384: \-mabicalls
385: \-mno\-abicalls
386: \-mhalf\-pic
387: \-mno\-half\-pic
388: \-G \fInum\fP
389:
390: .TP
391: .B Code Generation Options
392: .RI +e N
393: .RI \-fcall\-saved\- reg
394: .RI \-fcall\-used\- reg
395: .RI \-ffixed\- reg
396: \-fno\-common
397: \-fno\-gnu\-binutils
398: \-fnonnull\-objects
399: \-fpcc\-struct\-return
400: \-fpic
401: \-fPIC
402: \-fshared\-data
403: \-fshort\-enums
404: \-fshort\-double
405: \-fvolatile
406: .ad b
407: .hy 1
408:
409: .SH OVERALL OPTIONS
410: .TP
411: .BI "\-x " "language"
412: Specify explicitly the
413: .I language\c
414: \& for the following input files (rather than choosing a default based
415: on the file name suffix) . This option applies to all following input
416: files until the next `\|\c
417: .B \-x\c
418: \&\|' option. Possible values of \c
419: .I language\c
420: \& are
421: `\|\c
422: .B c\c
423: \&\|', `\|\c
424: .B objective\-c\c
425: \&\|', `\|\c
426: .B c\-header\c
427: \&\|', `\|\c
428: .B c++\c
429: \&\|',
430: `\|\c
431: .B cpp\-output\c
432: \&\|', `\|\c
433: .B assembler\c
434: \&\|', and `\|\c
435: .B assembler\-with\-cpp\c
436: \&\|'.
437: .TP
438: .B \-x none
439: Turn off any specification of a language, so that subsequent files are
440: handled according to their file name suffixes (as they are if `\|\c
441: .B \-x\c
442: \&\|'
443: has not been used at all).
444: .PP
445:
446: If you want only some of the four stages (preprocess, compile,
447: assemble, link), you can use
448: `\|\c
449: .B \-x\c
450: \&\|' (or filename suffixes) to tell \c
451: .B gcc\c
452: \& where to start, and
453: one of the options `\|\c
454: .B \-c\c
455: \&\|', `\|\c
456: .B \-S\c
457: \&\|', or `\|\c
458: .B \-E\c
459: \&\|' to say where
460: \c
461: .B gcc\c
462: \& is to stop. Note that some combinations (for example,
463: `\|\c
464: .B \-x cpp\-output \-E\c
465: \&\|') instruct \c
466: .B gcc\c
467: \& to do nothing at all.
468: .TP
469: .B \-c
470: Compile or assemble the source files, but do not link. The compiler
471: output is an object file corresponding to each source file.
472:
473: By default, GCC makes the object file name for a source file by replacing
474: the suffix `\|\c
475: .B .c\c
476: \&\|', `\|\c
477: .B .i\c
478: \&\|', `\|\c
479: .B .s\c
480: \&\|', etc., with `\|\c
481: .B .o\c
482: \&\|'. Use
483: .B \-o\c
484: \& to select another name.
485:
486: GCC ignores any unrecognized input files (those that do not require
487: compilation or assembly) with the
488: .B \-c
489: option.
490: .TP
491: .B \-S
492: Stop after the stage of compilation proper; do not assemble. The output
493: is an assembler code file for each non-assembler input
494: file specified.
495:
496: By default, GCC makes the assembler file name for a source file by
497: replacing the suffix `\|\c
498: .B .c\c
499: \&\|', `\|\c
500: .B .i\c
501: \&\|', etc., with `\|\c
502: .B .s\c
503: \&\|'. Use
504: .B \-o\c
505: \& to select another name.
506:
507:
508: GCC ignores any input files that don't require compilation.
509: .TP
510: .B \-E
511: Stop after the preprocessing stage; do not run the compiler proper. The
512: output is preprocessed source code, which is sent to the
513: standard output.
514:
515: GCC ignores input files which don't require preprocessing.
516: .TP
517: .BI "\-o " file\c
518: \&
519: Place output in file \c
520: .I file\c
521: \&. This applies regardless to whatever
522: sort of output GCC is producing, whether it be an executable file,
523: an object file, an assembler file or preprocessed C code.
524:
525: Since only one output file can be specified, it does not make sense to
526: use `\|\c
527: .B \-o\c
528: \&\|' when compiling more than one input file, unless you are
529: producing an executable file as output.
530:
531: If you do not specify `\|\c
532: .B \-o\c
533: \&\|', the default is to put an executable file
534: in `\|\c
535: .B a.out\c
536: \&\|', the object file for `\|\c
537: .B \c
538: .I source\c
539: \&.\c
540: .I suffix\c
541: \&\c
542: \&\|' in
543: `\|\c
544: .B \c
545: .I source\c
546: \&.o\c
547: \&\|', its assembler file in `\|\c
548: .B \c
549: .I source\c
550: \&.s\c
551: \&\|', and
552: all preprocessed C source on standard output.
553: .TP
554: .B \-v
555: Print (on standard error output) the commands executed to run the stages
556: of compilation. Also print the version number of the compiler driver
557: program and of the preprocessor and the compiler proper.
558: .TP
559: .B \-vpath
560: Print (on standard error output) all attempts at finding files, tracing
561: how the `\|\c
562: .B \-B\c
563: \&\|', `\|\c
564: .B \-b\c
565: \&\|', and `\|\c
566: .B \-V\c
567: \&\|' options interact. Also,
568: print the commands executed to run the stages of compilation and version
569: numbers, like the `\|\c
570: .B \-v\c
571: \&\|' option.
572: .TP
573: .B \-vspec
574: Print (on standard error output) all spec's processed by the
575: \c
576: .B do_spec_1\c
577: \& function in `\|\c
578: .B gcc.c\c
579: \&\|'. Also, print the commands
580: executed to run the stages of compilation and version numbers, like the
581: `\|\c
582: .B \-v\c
583: \&\|' option.
584: .TP
585: .B \-pipe
586: Use pipes rather than temporary files for communication between the
587: various stages of compilation. This fails to work on some systems where
588: the assembler cannot read from a pipe; but the GNU assembler has
589: no trouble.
590: .PP
591:
592: .SH LANGUAGE OPTIONS
593: The following options control the dialect of C that the compiler
594: accepts:
595: .TP
596: .B \-ansi
597: .I
598: Support all ANSI standard C programs.
599: .I
600:
601: This turns off certain features of GNU C that are incompatible with
602: ANSI C, such as the \c
603: .B asm\c
604: \&, \c
605: .B inline\c
606: \& and \c
607: .B typeof\c
608: \&
609: keywords, and predefined macros such as \c
610: .B unix\c
611: \& and \c
612: .B vax\c
613: \&
614: that identify the type of system you are using. It also enables the
615: undesirable and rarely used ANSI trigraph feature, and makes the
616: preprocessor accept `\|\c
617: .B $\c
618: \&\|' as part of identifiers.
619:
620: The alternate keywords \c
621: .B __asm__\c
622: \&, \c
623: .B __extension__\c
624: \&,
625: \c
626: .B __inline__\c
627: \& and \c
628: .B __typeof__\c
629: \& continue to work despite
630: `\|\c
631: .B \-ansi\c
632: \&\|'. You would not want to use them in an ANSI C program, of
633: course, but it is useful to put them in header files that might be included
634: in compilations done with `\|\c
635: .B \-ansi\c
636: \&\|'. Alternate predefined macros
637: such as \c
638: .B __unix__\c
639: \& and \c
640: .B __vax__\c
641: \& are also available, with or
642: without `\|\c
643: .B \-ansi\c
644: \&\|'.
645:
646: The `\|\c
647: .B \-ansi\c
648: \&\|' option does not cause non-ANSI programs to be
649: rejected gratuitously. For that, `\|\c
650: .B \-pedantic\c
651: \&\|' is required in
652: addition to `\|\c
653: .B \-ansi\c
654: \&\|'.
655:
656: The preprocessor predefines a macro \c
657: .B __STRICT_ANSI__\c
658: \& when you use the `\|\c
659: .B \-ansi\c
660: \&\|'
661: option. Some header files may notice this macro and refrain
662: from declaring certain functions or defining certain macros that the
663: ANSI standard doesn't call for; this is to avoid interfering with any
664: programs that might use these names for other things.
665: .TP
666: .B \-fno\-asm
667: Do not recognize \c
668: .B asm\c
669: \&, \c
670: .B inline\c
671: \& or \c
672: .B typeof\c
673: \& as a
674: keyword. These words may then be used as identifiers. You can
675: use \c
676: .B __asm__\c
677: \&, \c
678: .B __inline__\c
679: \& and \c
680: .B __typeof__\c
681: \& instead.
682: `\|\c
683: .B \-ansi\c
684: \&\|' implies `\|\c
685: .B \-fno\-asm\c
686: \&\|'.
687: .TP
688: .B \-fno\-builtin
689: .I (Ignored for C++.)
690: Don't recognize non-ANSI built-in functions. `\|\c
691: .B \-ansi\c
692: \&\|' also has this
693: effect. Currently, the only function affected is
694: .B alloca\c
695: \&.
696: .TP
697: .B \-fno\-strict\-prototype
698: .I
699: (C++ only.)
700: Consider the declaration \c
701: .B int foo ();\c
702: \&. In C++, this means that the
703: function \c
704: .B foo\c
705: \& takes no arguments. In ANSI C, this is declared
706: .B int foo(void);\c
707: \&. With the flag `\|\c
708: .B \-fno\-strict\-prototype\c
709: \&\|',
710: declaring functions with no arguments is equivalent to declaring its
711: argument list to be untyped, i.e., \c
712: .B int foo ();\c
713: \& is equivalent to
714: saying \c
715: .B int foo (...);\c
716: \&.
717: .TP
718: .B \-trigraphs
719: Support ANSI C trigraphs. The `\|\c
720: .B \-ansi\c
721: \&\|' option implies `\|\c
722: .B \-trigraphs\c
723: \&\|'.
724: .TP
725: .B \-traditional
726: Attempt to support some aspects of traditional C compilers.
727:
728: Specifically, for both C and C++ programs:
729: .TP
730: \ \ \ \(bu
731: In the preprocessor, comments convert to nothing at all, rather than
732: to a space. This allows traditional token concatenation.
733: .TP
734: \ \ \ \(bu
735: In the preprocessor, macro arguments are recognized within string
736: constants in a macro definition (and their values are stringified,
737: though without additional quote marks, when they appear in such a
738: context). The preprocessor always considers a string constant to end
739: at a newline.
740: .TP
741: \ \ \ \(bu
742: The preprocessor does not predefine the macro \c
743: .B __STDC__\c
744: \& when you use
745: `\|\c
746: .B \-traditional\c
747: \&\|', but still predefines\c
748: .B __GNUC__\c
749: \& (since the GNU extensions indicated by
750: .B __GNUC__\c
751: \& are not affected by
752: `\|\c
753: .B \-traditional\c
754: \&\|'). If you need to write header files that work
755: differently depending on whether `\|\c
756: .B \-traditional\c
757: \&\|' is in use, by
758: testing both of these predefined macros you can distinguish four
759: situations: GNU C, traditional GNU C, other ANSI C compilers, and
760: other old C compilers.
761: .TP
762: \ \ \ \(bu
763: In the preprocessor, comments convert to nothing at all, rather than
764: to a space. This allows traditional token concatenation.
765: .TP
766: \ \ \ \(bu
767: In the preprocessor, macro arguments are recognized within string
768: constants in a macro definition (and their values are stringified,
769: though without additional quote marks, when they appear in such a
770: context). The preprocessor always considers a string constant to end
771: at a newline.
772: .TP
773: \ \ \ \(bu
774: The preprocessor does not predefine the macro \c
775: .B __STDC__\c
776: \& when you use
777: `\|\c
778: .B \-traditional\c
779: \&\|', but still predefines\c
780: .B __GNUC__\c
781: \& (since the GNU extensions indicated by
782: .B __GNUC__\c
783: \& are not affected by
784: `\|\c
785: .B \-traditional\c
786: \&\|'). If you need to write header files that work
787: differently depending on whether `\|\c
788: .B \-traditional\c
789: \&\|' is in use, by
790: testing both of these predefined macros you can distinguish four
791: situations: GNU C, traditional GNU C, other ANSI C compilers, and
792: other old C compilers.
793: .PP
794: .TP
795: \ \ \ \(bu
796: String ``constants'' are not necessarily constant; they are stored in
797: writable space, and identical looking constants are allocated
798: separately. (This is the same as the effect of
799: `\|\c
800: .B \-fwritable\-strings\c
801: \&\|'.)
802:
803: In addition, `\|\c
804: .B \-traditional\c
805: \&\|' has these effects for C programs (not C++):
806: .TP
807: \ \ \ \(bu
808: All \c
809: .B extern\c
810: \& declarations take effect globally even if they
811: are written inside of a function definition. This includes implicit
812: declarations of functions.
813: .TP
814: \ \ \ \(bu
815: The keywords \c
816: .B typeof\c
817: \&, \c
818: .B inline\c
819: \&, \c
820: .B signed\c
821: \&, \c
822: .B const\c
823: \&
824: and \c
825: .B volatile\c
826: \& are not recognized. (You can still use the
827: alternative keywords such as \c
828: .B __typeof__\c
829: \&, \c
830: .B __inline__\c
831: \&, and
832: so on.)
833: .TP
834: \ \ \ \(bu
835: Comparisons between pointers and integers are always allowed.
836: .TP
837: \ \ \ \(bu
838: Integer types \c
839: .B unsigned short\c
840: \& and \c
841: .B unsigned char\c
842: \& promote
843: to \c
844: .B unsigned int\c
845: \&.
846: .TP
847: \ \ \ \(bu
848: Out-of-range floating point literals are not an error.
849: .TP
850: \ \ \ \(bu
851: All automatic variables not declared \c
852: .B register\c
853: \& are preserved by
854: \c
855: .B longjmp\c
856: \&. Ordinarily, GNU C follows ANSI C: automatic variables
857: not declared \c
858: .B volatile\c
859: \& may be clobbered.
860:
861: Finally, for C++ programs only (not C), `\|\c
862: .B \-traditional\c
863: \&\|' has one additional effect: assignment to
864: .B this
865: is permitted. This is the same as the effect of `\|\c
866: .B \-fthis\-is\-variable\c
867: \&\|'.
868: .TP
869: .B \-traditional\-cpp
870: Attempt to support some aspects of traditional C preprocessors.
871: This includes the items that specifically mention the preprocessor above,
872: but none of the other effects of `\|\c
873: .B \-traditional\c
874: \&\|'.
875: .TP
876: .B \-fdollars\-in\-identifiers
877: .I
878: (C++ only.)
879: Permit the use of `\|\c
880: .B $\c
881: \&\|' in identifiers. (For GNU C, this is the default, and you can
882: forbid it with `\|\c
883: .B \-ansi\c
884: \&\|'.)
885: Traditional C allowed the character `\|\c
886: .B $\c
887: \&\|' to form part of identifiers; by default, GNU C also
888: allows this. However, ANSI C forbids `\|\c
889: .B $\c
890: \&\|' in identifiers, and GNU C++ also forbids it by default on most
891: platforms (though on some platforms it's enabled by default for GNU
892: C++ as well).
893: .TP
894: .B \-fenum\-int\-equiv
895: .I
896: (C++ only.)
897: Normally GNU C++ allows conversion of
898: .B enum
899: to
900: .B int\c
901: \&, but not the other way around. Use this option if you want GNU C++
902: to allow conversion of
903: .B int
904: to
905: .B enum
906: as well.
907: .TP
908: .B \-fall\-virtual
909: .I
910: (C++ only.)
911: When you use the `\|\c
912: .B \-fall\-virtual\c
913: \&\|', all member functions
914: (except for constructor functions and new/delete member operators)
915: declared in the same class with a ``method-call'' operator method are
916: treated as virtual functions of the given class. In effect, all
917: of these methods become ``implicitly virtual.''
918:
919: This does \c
920: .I not\c
921: \& mean that all calls to these methods will be made through the
922: internal table of virtual functions. There are some circumstances
923: under which it is obvious that a call to a given virtual function can
924: be made directly, and in these cases the calls still go direct.
925:
926: The effect of making all methods of a class with a declared
927: \&`\|\c
928: .B
929: operator->()()\c
930: \&\|' implicitly virtual using `\|\c
931: .B \-fall\-virtual\c
932: \&\|' extends
933: also to all non-constructor methods of any class derived from such a
934: class.
935: .TP
936: .B \-fcond\-mismatch
937: Allow conditional expressions with mismatched types in the second and
938: third arguments. The value of such an expression is void.
939: .TP
940: .B \-fthis\-is\-variable
941: .I
942: (C++ only.)
943: The incorporation of user-defined free store management into C++ has
944: made assignment to \c
945: .B this\c
946: \& an anachronism. Therefore, by default GNU
947: C++ treats the type of \c
948: .B this\c
949: \& in a member function of \c
950: .B class X\c
951: \&
952: to be \c
953: .B X *const\c
954: \&. In other words, it is illegal to assign to
955: \c
956: .B this\c
957: \& within a class member function. However, for backwards
958: compatibility, you can invoke the old behavior by using
959: \&`\|\c
960: .B \-fthis\-is\-variable\c
961: \&\|'.
962: .TP
963: .B \-funsigned\-char
964: Let the type \c
965: .B char\c
966: \& be unsigned, like \c
967: .B unsigned char\c
968: \&.
969:
970: Each kind of machine has a default for what \c
971: .B char\c
972: \& should
973: be. It is either like \c
974: .B unsigned char\c
975: \& by default or like
976: \c
977: .B signed char\c
978: \& by default.
979:
980: Ideally, a portable program should always use \c
981: .B signed char\c
982: \& or
983: \c
984: .B unsigned char\c
985: \& when it depends on the signedness of an object.
986: But many programs have been written to use plain \c
987: .B char\c
988: \& and
989: expect it to be signed, or expect it to be unsigned, depending on the
990: machines they were written for. This option, and its inverse, let you
991: make such a program work with the opposite default.
992:
993: The type \c
994: .B char\c
995: \& is always a distinct type from each of
996: \c
997: .B signed char\c
998: \& and \c
999: .B unsigned char\c
1000: \&, even though its behavior
1001: is always just like one of those two.
1002:
1003: .TP
1004: .B \-fsigned\-char
1005: Let the type \c
1006: .B char\c
1007: \& be signed, like \c
1008: .B signed char\c
1009: \&.
1010:
1011: Note that this is equivalent to `\|\c
1012: .B \-fno\-unsigned\-char\c
1013: \&\|', which is
1014: the negative form of `\|\c
1015: .B \-funsigned\-char\c
1016: \&\|'. Likewise,
1017: `\|\c
1018: .B \-fno\-signed\-char\c
1019: \&\|' is equivalent to `\|\c
1020: .B \-funsigned\-char\c
1021: \&\|'.
1022: .TP
1023: .B \-fsigned\-bitfields
1024: .TP
1025: .B \-funsigned\-bitfields
1026: .TP
1027: .B \-fno\-signed\-bitfields
1028: .TP
1029: .B \-fno\-unsigned\-bitfields
1030: These options control whether a bitfield is
1031: signed or unsigned, when declared with no explicit `\|\c
1032: .B signed\c
1033: \&\|' or `\|\c
1034: .B unsigned\c
1035: \&\|' qualifier. By default, such a bitfield is
1036: signed, because this is consistent: the basic integer types such as
1037: \c
1038: .B int\c
1039: \& are signed types.
1040:
1041: However, when you specify `\|\c
1042: .B \-traditional\c
1043: \&\|', bitfields are all unsigned
1044: no matter what.
1045: .TP
1046: .B \-fwritable\-strings
1047: Store string constants in the writable data segment and don't uniquize
1048: them. This is for compatibility with old programs which assume they
1049: can write into string constants. `\|\c
1050: .B \-traditional\c
1051: \&\|' also has this
1052: effect.
1053:
1054: Writing into string constants is a very bad idea; ``constants'' should
1055: be constant.
1056: .PP
1057:
1058: .SH PREPROCESSOR OPTIONS
1059: These options control the C preprocessor, which is run on each C source
1060: file before actual compilation.
1061:
1062: If you use the `\|\c
1063: .B \-E\c
1064: \&\|' option, GCC does nothing except preprocessing.
1065: Some of these options make sense only together with `\|\c
1066: .B \-E\c
1067: \&\|' because
1068: they cause the preprocessor output to be unsuitable for actual
1069: compilation.
1070: .TP
1071: .BI "\-i " file\c
1072: \&
1073: Process \c
1074: .I file\c
1075: \& as input, discarding the resulting output, before
1076: processing the regular input file. Because the output generated from
1077: \c
1078: .I file\c
1079: \& is discarded, the only effect of `\|\c
1080: .B \-i \c
1081: .I file\c
1082: \&\c
1083: \&\|' is to
1084: make the macros defined in \c
1085: .I file\c
1086: \& available for use in the main
1087: input. The preprocessor evaluates any `\|\c
1088: .B \-D\c
1089: \&\|' and `\|\c
1090: .B \-U\c
1091: \&\|' options
1092: on the command line before processing `\|\c
1093: .B \-i\c
1094: \&\|' \c
1095: .I file\c
1096: \&.
1097: .TP
1098: .B \-nostdinc
1099: Do not search the standard system directories for header files. Only
1100: the directories you have specified with `\|\c
1101: .B \-I\c
1102: \&\|' options (and the
1103: current directory, if appropriate) are searched.
1104:
1105: By using both `\|\c
1106: .B \-nostdinc\c
1107: \&\|' and `\|\c
1108: .B \-I\-\c
1109: \&\|', you can limit the include-file search file to only those
1110: directories you specify explicitly.
1111: .TP
1112: .B \-undef
1113: Do not predefine any nonstandard macros. (Including architecture flags).
1114: .TP
1115: .B \-E
1116: Run only the C preprocessor. Preprocess all the C source files
1117: specified and output the results to standard output or to the
1118: specified output file.
1119: .TP
1120: .B \-C
1121: Tell the preprocessor not to discard comments. Used with the
1122: `\|\c
1123: .B \-E\c
1124: \&\|' option.
1125: .TP
1126: .B \-P
1127: Tell the preprocessor not to generate `\|\c
1128: .B #line\c
1129: \&\|' commands.
1130: Used with the `\|\c
1131: .B \-E\c
1132: \&\|' option.
1133: .TP
1134: .B \-M
1135: Tell the preprocessor to output a rule suitable for \c
1136: .B make\c
1137: \&
1138: describing the dependencies of each object file. For each source file,
1139: the preprocessor outputs one \c
1140: .B make\c
1141: \&-rule whose target is the object
1142: file name for that source file and whose dependencies are all the files
1143: `\|\c
1144: .B #include\c
1145: \&\|'d in it. This rule may be a single line or may be
1146: continued with `\|\c
1147: .B \e\c
1148: \&\|'-newline if it is long. The list of rules is
1149: printed on standard output instead of the preprocessed C program.
1150:
1151: `\|\c
1152: .B \-M\c
1153: \&\|' implies `\|\c
1154: .B \-E\c
1155: \&\|'.
1156: .TP
1157: .B \-MM
1158: Like `\|\c
1159: .B \-M\c
1160: \&\|' but the output mentions only the user header files
1161: included with `\|\c
1162: .B #include "\c
1163: .I file\c
1164: \&"\c
1165: \&\|'. System header files
1166: included with `\|\c
1167: .B #include <\c
1168: .I file\c
1169: \&>\c
1170: \&\|' are omitted.
1171: .TP
1172: .B \-MD
1173: Like `\|\c
1174: .B \-M\c
1175: \&\|' but the dependency information is written to files with
1176: names made by replacing `\|\c
1177: .B .c\c
1178: \&\|' with `\|\c
1179: .B .d\c
1180: \&\|' at the end of the
1181: input file names. This is in addition to compiling the file as
1182: specified\(em\&`\|\c
1183: .B \-MD\c
1184: \&\|' does not inhibit ordinary compilation the way
1185: `\|\c
1186: .B \-M\c
1187: \&\|' does.
1188:
1189: The Mach utility `\|\c
1190: .B md\c
1191: \&\|' can be used to merge the `\|\c
1192: .B .d\c
1193: \&\|' files
1194: into a single dependency file suitable for using with the `\|\c
1195: .B make\c
1196: \&\|'
1197: command.
1198: .TP
1199: .B \-MMD
1200: Like `\|\c
1201: .B \-MD\c
1202: \&\|' except mention only user header files, not system
1203: header files.
1204: .TP
1205: .B \-H
1206: Print the name of each header file used, in addition to other normal
1207: activities.
1208: .TP
1209: .BI \-D macro
1210: Define macro \c
1211: .I macro\c
1212: \& with the string `\|\c
1213: .B 1\c
1214: \&\|' as its definition.
1215: .TP
1216: .BI \-D macro = defn
1217: Define macro \c
1218: .I macro\c
1219: \& as \c
1220: .I defn\c
1221: \&. All instances of `\|\c
1222: .B \-D\c
1223: \&\|' on
1224: the command line are processed before any `\|\c
1225: .B \-U\c
1226: \&\|' or `\|\c
1227: .B \-i\c
1228: \&\|' options.
1229: .TP
1230: .BI \-U macro
1231: Undefine macro \c
1232: .I macro\c
1233: \&. `\|\c
1234: .B \-U\c
1235: \&\|' options are evaluated after all `\|\c
1236: .B \-D\c
1237: \&\|' options, but before any `\|\c
1238: .B \-i\c
1239: \&\|' options.
1240: .TP
1241: .B \-dM
1242: Tell the preprocessor to output only a list of the macro definitions
1243: that are in effect at the end of preprocessing. Used with the `\|\c
1244: .B \-E\c
1245: \&\|'
1246: option.
1247: .TP
1248: .B \-dD
1249: Tell the preprocessing to pass all macro definitions into the output, in
1250: their proper sequence in the rest of the output.
1251: .TP
1252: .B \-dN
1253: Like `\|\c
1254: .B \-dD\c
1255: \&\|' except that the macro arguments and contents are omitted.
1256: Only `\|\c
1257: .B #define \c
1258: .I name\c
1259: \&\c
1260: \&\|' is included in the output.
1261: .PP
1262:
1263: .SH LINKER OPTIONS
1264: These options come into play when the compiler links object files into
1265: an executable output file. They are meaningless if the compiler is
1266: not doing a link step.
1267: .TP
1268: .I object-file-name
1269: A file name that does not end in a special recognized suffix is
1270: considered to name an object file or library. (Object files are
1271: distinguished from libraries by the linker according to the file
1272: contents.) If GCC does a link step, these object files are used as input
1273: to the linker.
1274: .TP
1275: .B \-dynamic
1276: On systems that support dynamic linking, you can use this option to
1277: request it explicitly.
1278: .TP
1279: .BI \-l library\c
1280: \&
1281: Use the library named \c
1282: .I library\c
1283: \& when linking.
1284:
1285: The linker searches a standard list of directories for the library,
1286: which is actually a file named `\|\c
1287: .B lib\c
1288: .I library\c
1289: \&.a\c
1290: \&\|'. The linker
1291: then uses this file as if it had been specified precisely by name.
1292:
1293: The directories searched include several standard system directories
1294: plus any that you specify with `\|\c
1295: .B \-L\c
1296: \&\|'.
1297:
1298: Normally the files found this way are library files\(em\&archive files
1299: whose members are object files. The linker handles an archive file by
1300: scanning through it for members which define symbols that have so far
1301: been referenced but not defined. However, if the linker finds an
1302: ordinary object file rather than a library, the object file is linked
1303: in the usual fashion. The only difference between using an `\|\c
1304: .B \-l\c
1305: \&\|' option and specifying a file
1306: name is that `\|\c
1307: .B \-l\c
1308: \&\|' surrounds
1309: .I library
1310: with `\|\c
1311: .B lib\c
1312: \&\|' and `\|\c
1313: .B .a\c
1314: \&\|' and searches several directories.
1315: .TP
1316: .B \-nostdlib
1317: Don't use the standard system libraries and startup files when linking.
1318: Only the files you specify will be passed to the linker.
1319: .TP
1320: .B \-static
1321: On systems that support dynamic linking, this prevents linking with the shared
1322: libraries. (`\|\c
1323: .B \-g\c
1324: \&\|' also has this effect.) On other systems, this option has no effect.
1325: .PP
1326:
1327: .SH DIRECTORY OPTIONS
1328: These options specify directories to search for header files, for
1329: libraries and for parts of the compiler:
1330: .TP
1331: .BI "\-I" "dir"\c
1332: \&
1333: Append directory \c
1334: .I dir\c
1335: \& to the list of directories searched for include files.
1336: .TP
1337: .B \-I\-
1338: Any directories you specify with `\|\c
1339: .B \-I\c
1340: \&\|' options before the `\|\c
1341: .B \-I\-\c
1342: \&\|'
1343: option are searched only for the case of `\|\c
1344: .B
1345: #include "\c
1346: .I file\c
1347: .B
1348: \&"\c
1349: \&\|';
1350: they are not searched for `\|\c
1351: .B #include <\c
1352: .I file\c
1353: \&>\c
1354: \&\|'.
1355:
1356: If additional directories are specified with `\|\c
1357: .B \-I\c
1358: \&\|' options after
1359: the `\|\c
1360: .B \-I\-\c
1361: \&\|', these directories are searched for all `\|\c
1362: .B #include\c
1363: \&\|'
1364: directives. (Ordinarily \c
1365: .I all\c
1366: \& `\|\c
1367: .B \-I\c
1368: \&\|' directories are used
1369: this way.)
1370:
1371: In addition, the `\|\c
1372: .B \-I\-\c
1373: \&\|' option inhibits the use of the current
1374: directory (where the current input file came from) as the first search
1375: directory for `\|\c
1376: .B
1377: #include "\c
1378: .I file\c
1379: .B
1380: \&"\c
1381: \&\|'. There is no way to
1382: override this effect of `\|\c
1383: .B \-I\-\c
1384: \&\|'. With `\|\c
1385: .B \-I.\c
1386: \&\|' you can specify
1387: searching the directory which was current when the compiler was
1388: invoked. That is not exactly the same as what the preprocessor does
1389: by default, but it is often satisfactory.
1390:
1391: `\|\c
1392: .B \-I\-\c
1393: \&\|' does not inhibit the use of the standard system directories
1394: for header files. Thus, `\|\c
1395: .B \-I\-\c
1396: \&\|' and `\|\c
1397: .B \-nostdinc\c
1398: \&\|' are
1399: independent.
1400: .TP
1401: .BI "\-L" "dir"\c
1402: \&
1403: Add directory \c
1404: .I dir\c
1405: \& to the list of directories to be searched
1406: for `\|\c
1407: .B \-l\c
1408: \&\|'.
1409: .TP
1410: .BI "\-B" "prefix"\c
1411: \&
1412: This option specifies where to find the executables, libraries and
1413: data files of the compiler itself.
1414:
1415: The compiler driver program runs one or more of the subprograms
1416: `\|\c
1417: .B cpp\c
1418: \&\|', `\|\c
1419: .B cc1\c
1420: \&\|' (or, for C++, `\|\c
1421: .B cc1plus\c
1422: \&\|'), `\|\c
1423: .B as\c
1424: \&\|' and `\|\c
1425: .B ld\c
1426: \&\|'. It tries
1427: \c
1428: .I prefix\c
1429: \& as a prefix for each program it tries to run, both with and
1430: without `\|\c
1431: .B \c
1432: .I machine\c
1433: \&/\c
1434: .I version\c
1435: \&/\c
1436: \&\|'.
1437:
1438: For each subprogram to be run, the compiler driver first tries the
1439: `\|\c
1440: .B \-B\c
1441: \&\|' prefix, if any. If that name is not found, or if `\|\c
1442: .B \-B\c
1443: \&\|'
1444: was not specified, the driver tries two standard prefixes, which are
1445: `\|\c
1446: .B /usr/lib/gcc/\c
1447: \&\|' and `\|\c
1448: .B /usr/local/lib/gcc/\c
1449: \&\|'. If neither of
1450: those results in a file name that is found, the compiler driver
1451: searches for the unmodified program
1452: name, using the directories specified in your
1453: `\|\c
1454: .B PATH\c
1455: \&\|' environment variable.
1456:
1457: The run-time support file `\|\c
1458: .B libgcc.a\c
1459: \&\|' is also searched for using the
1460: `\|\c
1461: .B \-B\c
1462: \&\|' prefix, if needed. If it is not found there, the two
1463: standard prefixes above are tried, and that is all. The file is left
1464: out of the link if it is not found by those means. Most of the time,
1465: on most machines, `\|\c
1466: .B libgcc.a\c
1467: \&\|' is not actually necessary.
1468:
1469: You can get a similar result from the environment variable
1470: \c
1471: .B GCC_EXEC_PREFIX\c
1472: \&; if it is defined, its value is used as a prefix
1473: in the same way. If both the `\|\c
1474: .B \-B\c
1475: \&\|' option and the
1476: \c
1477: .B GCC_EXEC_PREFIX\c
1478: \& variable are present, the `\|\c
1479: .B \-B\c
1480: \&\|' option is
1481: used first and the environment variable value second.
1482: .PP
1483:
1484: .SH WARNING OPTIONS
1485: Warnings are diagnostic messages that report constructions which
1486: are not inherently erroneous but which are risky or suggest there
1487: may have been an error.
1488:
1489: These options control the amount and kinds of warnings produced by GNU
1490: CC:
1491: .TP
1492: .B \-fsyntax\-only
1493: Check the code for syntax errors, but don't emit any output.
1494: .TP
1495: .B \-w
1496: Inhibit all warning messages.
1497: .TP
1498: .B \-pedantic
1499: Issue all the warnings demanded by strict ANSI standard C; reject
1500: all programs that use forbidden extensions.
1501:
1502: Valid ANSI standard C programs should compile properly with or without
1503: this option (though a rare few will require `\|\c
1504: .B \-ansi\c
1505: \&\|'). However,
1506: without this option, certain GNU extensions and traditional C features
1507: are supported as well. With this option, they are rejected. There is
1508: no reason to \c
1509: .I use\c
1510: \& this option; it exists only to satisfy pedants.
1511:
1512: `\|\c
1513: .B \-pedantic\c
1514: \&\|' does not cause warning messages for use of the
1515: alternate keywords whose names begin and end with `\|\c
1516: .B __\c
1517: \&\|'. Pedantic
1518: warnings are also disabled in the expression that follows
1519: \c
1520: .B __extension__\c
1521: \&. However, only system header files should use
1522: these escape routes; application programs should avoid them.
1523: .TP
1524: .B \-pedantic\-errors
1525: Like `\|\c
1526: .B \-pedantic\c
1527: \&\|', except that errors are produced rather than
1528: warnings.
1529: .TP
1530: .B \-Werror
1531: Treat warnings as errors; abort compilation after any warning.
1532: .TP
1533: .B \-W
1534: Print extra warning messages for these events:
1535: .TP
1536: \ \ \ \(bu
1537: A nonvolatile automatic variable might be changed by a call to
1538: \c
1539: .B longjmp\c
1540: \&. These warnings are possible only in
1541: optimizing compilation.
1542:
1543: The compiler sees only the calls to \c
1544: .B setjmp\c
1545: \&. It cannot know
1546: where \c
1547: .B longjmp\c
1548: \& will be called; in fact, a signal handler could
1549: call it at any point in the code. As a result, you may get a warning
1550: even when there is in fact no problem because \c
1551: .B longjmp\c
1552: \& cannot
1553: in fact be called at the place which would cause a problem.
1554: .TP
1555: \ \ \ \(bu
1556: A function can return either with or without a value. (Falling
1557: off the end of the function body is considered returning without
1558: a value.) For example, this function would evoke such a
1559: warning:
1560: .sp
1561: .br
1562: foo\ (a)
1563: .br
1564: {
1565: .br
1566: \ \ if\ (a\ >\ 0)
1567: .br
1568: \ \ \ \ return\ a;
1569: .br
1570: }
1571: .br
1572: .sp
1573:
1574: Spurious warnings can occur because GNU CC does not realize that
1575: certain functions (including \c
1576: .B abort\c
1577: \& and \c
1578: .B longjmp\c
1579: \&)
1580: will never return.
1581: .TP
1582: \ \ \ \(bu
1583: An expression-statement contains no side effects.
1584: .TP
1585: \ \ \ \(bu
1586: An unsigned value is compared against zero with `\|\c
1587: .B >\c
1588: \&\|' or `\|\c
1589: .B <=\c
1590: \&\|'.
1591: .PP
1592: .TP
1593: .B \-Wimplicit
1594: Warn whenever a function or parameter is implicitly declared.
1595: .TP
1596: .B \-Wreturn\-type
1597: Warn whenever a function is defined with a return-type that defaults
1598: to \c
1599: .B int\c
1600: \&. Also warn about any \c
1601: .B return\c
1602: \& statement with no
1603: return-value in a function whose return-type is not \c
1604: .B void\c
1605: \&.
1606: .TP
1607: .B \-Wunused
1608: Warn whenever a local variable is unused aside from its declaration,
1609: whenever a function is declared static but never defined, and whenever
1610: a statement computes a result that is explicitly not used.
1611: .TP
1612: .B \-Wswitch
1613: Warn whenever a \c
1614: .B switch\c
1615: \& statement has an index of enumeral type
1616: and lacks a \c
1617: .B case\c
1618: \& for one or more of the named codes of that
1619: enumeration. (The presence of a \c
1620: .B default\c
1621: \& label prevents this
1622: warning.) \c
1623: .B case\c
1624: \& labels outside the enumeration range also
1625: provoke warnings when this option is used.
1626: .TP
1627: .B \-Wcomment
1628: Warn whenever a comment-start sequence `\|\c
1629: .B /*\c
1630: \&\|' appears in a comment.
1631: .TP
1632: .B \-Wtrigraphs
1633: Warn if any trigraphs are encountered (assuming they are enabled).
1634: .TP
1635: .B \-Waggregate\-return
1636: Warn if any functions that return structures or unions are defined or
1637: called. (In languages where you can return an array, this also elicits
1638: a warning.)
1639: .TP
1640: .B \-Wformat
1641: Check calls to \c
1642: .B printf\c
1643: \& and \c
1644: .B scanf\c
1645: \&, etc., to make sure that
1646: the arguments supplied have types appropriate to the format string
1647: specified.
1648: .TP
1649: .B \-Wuninitialized
1650: An automatic variable is used without first being initialized.
1651:
1652: These warnings are possible only in optimizing compilation,
1653: because they require data flow information that is computed only
1654: when optimizing. If you don't specify `\|\c
1655: .B \-O\c
1656: \&\|', you simply won't
1657: get these warnings.
1658:
1659: These warnings occur only for variables that are candidates for
1660: register allocation. Therefore, they do not occur for a variable that
1661: is declared \c
1662: .B volatile\c
1663: \&, or whose address is taken, or whose size
1664: is other than 1, 2, 4 or 8 bytes. Also, they do not occur for
1665: structures, unions or arrays, even when they are in registers.
1666:
1667: Note that there may be no warning about a variable that is used only
1668: to compute a value that itself is never used, because such
1669: computations may be deleted by data flow analysis before the warnings
1670: are printed.
1671:
1672: These warnings are made optional because GNU CC is not smart
1673: enough to see all the reasons why the code might be correct
1674: despite appearing to have an error. Here is one example of how
1675: this can happen:
1676:
1677: .sp
1678: .br
1679: {
1680: .br
1681: \ \ int\ x;
1682: .br
1683: \ \ switch\ (y)
1684: .br
1685: \ \ \ \ {
1686: .br
1687: \ \ \ \ case\ 1:\ x\ =\ 1;
1688: .br
1689: \ \ \ \ \ \ break;
1690: .br
1691: \ \ \ \ case\ 2:\ x\ =\ 4;
1692: .br
1693: \ \ \ \ \ \ break;
1694: .br
1695: \ \ \ \ case\ 3:\ x\ =\ 5;
1696: .br
1697: \ \ \ \ }
1698: .br
1699: \ \ foo\ (x);
1700: .br
1701: }
1702: .br
1703: .sp
1704:
1705:
1706: If the value of \c
1707: .B y\c
1708: \& is always 1, 2 or 3, then \c
1709: .B x\c
1710: \& is
1711: always initialized, but GNU CC doesn't know this. Here is
1712: another common case:
1713:
1714: .sp
1715: .br
1716: {
1717: .br
1718: \ \ int\ save_y;
1719: .br
1720: \ \ if\ (change_y)\ save_y\ =\ y,\ y\ =\ new_y;
1721: .br
1722: \ \ .\|.\|.
1723: .br
1724: \ \ if\ (change_y)\ y\ =\ save_y;
1725: .br
1726: }
1727: .br
1728: .sp
1729:
1730:
1731: This has no bug because \c
1732: .B save_y\c
1733: \& is used only if it is set.
1734:
1735: Some spurious warnings can be avoided if you declare as
1736: \c
1737: .B volatile\c
1738: \& all the functions you use that never return.
1739: .TP
1740: .B \-Wstrict\-prototypes
1741: Warn if a function is declared or defined without specifying the
1742: argument types. (An old-style function definition is permitted without
1743: a warning if preceded by a declaration which specifies the argument
1744: types.)
1745: .TP
1746: .B \-Wmissing\-prototypes
1747: Warn if a global function is defined without a previous prototype
1748: declaration. This warning is issued even if the definition itself
1749: provides a prototype. The aim is to detect global functions that fail
1750: to be declared in header files.
1751: .TP
1752: .B \-Wall
1753: All of the above `\|\c
1754: .B \-W\c
1755: \&\|' options combined. These are all the
1756: options which pertain to usage that we recommend avoiding and that we
1757: believe is easy to avoid, even in conjunction with macros.
1758: .PP
1759:
1760: The remaining `\|\c
1761: .B \-W.\|.\|.\c
1762: \&\|' options are not implied by `\|\c
1763: .B \-Wall\c
1764: \&\|'
1765: because they warn about constructions that we consider reasonable to
1766: use, on occasion, in clean programs.
1767: .TP
1768: .B \-Wtraditional
1769: Warn about certain constructs that behave differently in traditional and
1770: ANSI C.
1771: .TP
1772: \ \ \ \(bu
1773: Macro arguments occurring within string constants in the macro body.
1774: These would substitute the argument in traditional C, but are part of
1775: the constant in ANSI C.
1776: .TP
1777: \ \ \ \(bu
1778: A function declared external in one block and then used after the end of
1779: the block.
1780: .TP
1781: \ \ \ \(bu
1782: A \c
1783: .B switch\c
1784: \& statement has an operand of type \c
1785: .B long\c
1786: \&.
1787: .PP
1788: .TP
1789: .B \-Wshadow
1790: Warn whenever a local variable shadows another local variable.
1791: .TP
1792: .BI "\-Wid\-clash\-" "len"\c
1793: \&
1794: Warn whenever two distinct identifiers match in the first \c
1795: .I len\c
1796: \&
1797: characters. This may help you prepare a program that will compile
1798: with certain obsolete, brain-damaged compilers.
1799: .TP
1800: .B \-Wpointer\-arith
1801: Warn about anything that depends on the ``size of'' a function type or
1802: of \c
1803: .B void\c
1804: \&. GNU C assigns these types a size of 1, for
1805: convenience in calculations with \c
1806: .B void *\c
1807: \& pointers and pointers
1808: to functions.
1809: .TP
1810: .B \-Wcast\-qual
1811: Warn whenever a pointer is cast so as to remove a type qualifier from
1812: the target type. For example, warn if a \c
1813: .B const char *\c
1814: \& is cast
1815: to an ordinary \c
1816: .B char *\c
1817: \&.
1818: .TP
1819: .B \-Wcast\-align
1820: Warn whenever a pointer is cast such that the required alignment of the
1821: target is increased. For example, warn if a \c
1822: .B char *\c
1823: \& is cast to
1824: an \c
1825: .B int *\c
1826: \& on machines where integers can only be accessed at
1827: two- or four-byte boundaries.
1828: .TP
1829: .B \-Wwrite\-strings
1830: Give string constants the type \c
1831: .B const char[\c
1832: .I length\c
1833: \&]\c
1834: \& so that
1835: copying the address of one into a non-\c
1836: .B const\c
1837: \& \c
1838: .B char *\c
1839: \&
1840: pointer will get a warning. These warnings will help you find at
1841: compile time code that can try to write into a string constant, but
1842: only if you have been very careful about using \c
1843: .B const\c
1844: \& in
1845: declarations and prototypes. Otherwise, it will just be a nuisance;
1846: this is why we did not make `\|\c
1847: .B \-Wall\c
1848: \&\|' request these warnings.
1849: .TP
1850: .B \-Wconversion
1851: Warn if a prototype causes a type conversion that is different from what
1852: would happen to the same argument in the absence of a prototype. This
1853: includes conversions of fixed point to floating and vice versa, and
1854: conversions changing the width or signedness of a fixed point argument
1855: except when the same as the default promotion.
1856: .TP
1857: .B \-Wenum\-clash
1858: .I (C++ only.)
1859: Warn when converting between different enumeration types.
1860: .TP
1861: .B \-Wno\-parentheses
1862: Disable warnings that parentheses are suggested around an expression.
1863: .TP
1864: .B \-Woverloaded\-virtual
1865: .I (C++ only.)
1866: In a derived class, the definitions of virtual functions must match
1867: the type signature of a virtual function declared in the base class.
1868: Use this option to request warnings when a derived class declares a
1869: function that may be an erroneous attempt to define a virtual
1870: function: that is, warn when a function with the same name as a
1871: virtual function in the base class, but with a type signature that
1872: doesn't match any virtual functions from the base class.
1873: .PP
1874:
1875: .SH DEBUGGING OPTIONS
1876: GNU CC has various special options that are used for debugging
1877: either your program or GCC:
1878: .TP
1879: .B \-g
1880: Produce debugging information in the operating system's native format
1881: (for DBX or SDB or DWARF). GDB also can work with this debugging
1882: information. On most systems that use DBX format, `\|\c
1883: .B \-g\c
1884: \&\|' enables use
1885: of extra debugging information that only GDB can use; if you want to
1886: control for certain whether to generate this information, use
1887: `\|\c
1888: .B \-ggdb\c
1889: \&\|' or `\|\c
1890: .B \-gdbx\c
1891: \&\|'.
1892:
1893: Unlike most other C compilers, GNU CC allows you to use `\|\c
1894: .B \-g\c
1895: \&\|' with
1896: `\|\c
1897: .B \-O\c
1898: \&\|'. The shortcuts taken by optimized code may occasionally
1899: produce surprising results: some variables you declared may not exist
1900: at all; flow of control may briefly move where you did not expect it;
1901: some statements may not be executed because they compute constant
1902: results or their values were already at hand; some statements may
1903: execute in different places because they were moved out of loops.
1904:
1905: Nevertheless it proves possible to debug optimized output. This makes
1906: it reasonable to use the optimizer for programs that might have bugs.
1907:
1908: The following options are useful when GNU CC is configured and
1909: compiled with the capability for more than one debugging format.
1910: .TP
1911: .B \-ggdb
1912: Produce debugging information in DBX format (if that is supported),
1913: including GDB extensions.
1914: .TP
1915: .B \-gdbx
1916: Produce debugging information in DBX format (if that is supported),
1917: without GDB extensions.
1918: .TP
1919: .B \-gsdb
1920: Produce debugging information in SDB format (if that is supported).
1921: .TP
1922: .B \-gdwarf
1923: Produce debugging information in DWARF format (if that is supported).
1924: .PP
1925: .BI "\-g" "level"
1926: .br
1927: .BI "\-ggdb" "level"
1928: .br
1929: .BI "\-gdbx" "level"
1930: .br
1931: .BI "\-gsdb" "level"
1932: .TP
1933: .BI "\-gdwarf" "level"
1934: Request debugging information and also use \c
1935: .I level\c
1936: \& to specify how
1937: much information. The default level is 2.
1938:
1939: Level 1 produces minimal information, enough for making backtraces in
1940: parts of the program that you don't plan to debug. This includes
1941: descriptions of functions and external variables, but no information
1942: about local variables and no line numbers.
1943: .TP
1944: .B \-p
1945: Generate extra code to write profile information suitable for the
1946: analysis program \c
1947: .B prof\c
1948: \&.
1949: .TP
1950: .B \-pg
1951: Generate extra code to write profile information suitable for the
1952: analysis program \c
1953: .B gprof\c
1954: \&.
1955: .TP
1956: .B \-a
1957: Generate extra code to write profile information for basic blocks,
1958: which will record the number of times each basic block is executed.
1959: This data could be analyzed by a program like \c
1960: .B tcov\c
1961: \&. Note,
1962: however, that the format of the data is not what \c
1963: .B tcov\c
1964: \& expects.
1965: Eventually GNU \c
1966: .B gprof\c
1967: \& should be extended to process this data.
1968: .TP
1969: .BI "\-d" "letters"\c
1970: \&
1971: Says to make debugging dumps during compilation at times specified by
1972: \c
1973: .I letters\c
1974: \&. This is used for debugging the compiler. The file names
1975: for most of the dumps are made by appending a word to the source file
1976: name (e.g. `\|\c
1977: .B foo.c.rtl\c
1978: \&\|' or `\|\c
1979: .B foo.c.jump\c
1980: \&\|').
1981: .TP
1982: .B \-dM
1983: Dump all macro definitions, at the end of preprocessing, and write no
1984: output.
1985: .TP
1986: .B \-dN
1987: Dump all macro names, at the end of preprocessing.
1988: .TP
1989: .B \-dD
1990: Dump all macro definitions, at the end of preprocessing, in addition to
1991: normal output.
1992: .TP
1993: .B \-dy
1994: Dump debugging information during parsing, to standard error.
1995: .TP
1996: .B \-dr
1997: Dump after RTL generation, to `\|\c
1998: .B \c
1999: .I file\c
2000: \&.rtl\c
2001: \&\|'.
2002: .TP
2003: .B \-dx
2004: Just generate RTL for a function instead of compiling it. Usually used
2005: with `\|\c
2006: .B r\c
2007: \&\|'.
2008: .TP
2009: .B \-dj
2010: Dump after first jump optimization, to `\|\c
2011: .B \c
2012: .I file\c
2013: \&.jump\c
2014: \&\|'.
2015: .TP
2016: .B \-ds
2017: Dump after CSE (including the jump optimization that sometimes
2018: follows CSE), to `\|\c
2019: .B \c
2020: .I file\c
2021: \&.cse\c
2022: \&\|'.
2023: .TP
2024: .B \-dL
2025: Dump after loop optimization, to `\|\c
2026: .B \c
2027: .I file\c
2028: \&.loop\c
2029: \&\|'.
2030: .TP
2031: .B \-dt
2032: Dump after the second CSE pass (including the jump optimization that
2033: sometimes follows CSE), to `\|\c
2034: .B \c
2035: .I file\c
2036: \&.cse2\c
2037: \&\|'.
2038: .TP
2039: .B \-df
2040: Dump after flow analysis, to `\|\c
2041: .B \c
2042: .I file\c
2043: \&.flow\c
2044: \&\|'.
2045: .TP
2046: .B \-dc
2047: Dump after instruction combination, to `\|\c
2048: .B \c
2049: .I file\c
2050: \&.combine\c
2051: \&\|'.
2052: .TP
2053: .B \-dS
2054: Dump after the first instruction scheduling pass, to
2055: `\|\c
2056: .B \c
2057: .I file\c
2058: \&.sched\c
2059: \&\|'.
2060: .TP
2061: .B \-dl
2062: Dump after local register allocation, to `\|\c
2063: .B \c
2064: .I file\c
2065: \&.lreg\c
2066: \&\|'.
2067: .TP
2068: .B \-dg
2069: Dump after global register allocation, to `\|\c
2070: .B \c
2071: .I file\c
2072: \&.greg\c
2073: \&\|'.
2074: .TP
2075: .B \-dR
2076: Dump after the second instruction scheduling pass, to
2077: `\|\c
2078: .B \c
2079: .I file\c
2080: \&.sched2\c
2081: \&\|'.
2082: .TP
2083: .B \-dJ
2084: Dump after last jump optimization, to `\|\c
2085: .B \c
2086: .I file\c
2087: \&.jump2\c
2088: \&\|'.
2089: .TP
2090: .B \-dd
2091: Dump after delayed branch scheduling, to `\|\c
2092: .B \c
2093: .I file\c
2094: \&.dbr\c
2095: \&\|'.
2096: .TP
2097: .B \-dk
2098: Dump after conversion from registers to stack, to `\|\c
2099: .B \c
2100: .I file\c
2101: \&.stack\c
2102: \&\|'.
2103: .TP
2104: .B \-dm
2105: Print statistics on memory usage, at the end of the run, to
2106: standard error.
2107: .TP
2108: .B \-dp
2109: Annotate the assembler output with a comment indicating which
2110: pattern and alternative was used.
2111: .TP
2112: .B \-fpretend\-float
2113: When running a cross-compiler, pretend that the target machine uses the
2114: same floating point format as the host machine. This causes incorrect
2115: output of the actual floating constants, but the actual instruction
2116: sequence will probably be the same as GNU CC would make when running on
2117: the target machine.
2118: .TP
2119: .B \-save\-temps
2120: Store the usual ``temporary'' intermediate files permanently; place them
2121: in the current directory and name them based on the source file. Thus,
2122: compiling `\|\c
2123: .B foo.c\c
2124: \&\|' with `\|\c
2125: .B \-c \-save\-temps\c
2126: \&\|' would produce files
2127: `\|\c
2128: .B foo.cpp\c
2129: \&\|' and `\|\c
2130: .B foo.s\c
2131: \&\|', as well as `\|\c
2132: .B foo.o\c
2133: \&\|'.
2134: .PP
2135:
2136: .SH OPTIMIZATION OPTIONS
2137: These options control various sorts of optimizations:
2138: .TP
2139: .B \-O
2140: Optimize. Optimizing compilation takes somewhat more time, and a lot
2141: more memory for a large function.
2142:
2143: Without `\|\c
2144: .B \-O\c
2145: \&\|', the compiler's goal is to reduce the cost of
2146: compilation and to make debugging produce the expected results.
2147: Statements are independent: if you stop the program with a breakpoint
2148: between statements, you can then assign a new value to any variable or
2149: change the program counter to any other statement in the function and
2150: get exactly the results you would expect from the source code.
2151:
2152: Without `\|\c
2153: .B \-O\c
2154: \&\|', only variables declared \c
2155: .B register\c
2156: \& are
2157: allocated in registers. The resulting compiled code is a little worse
2158: than produced by PCC without `\|\c
2159: .B \-O\c
2160: \&\|'.
2161:
2162: With `\|\c
2163: .B \-O\c
2164: \&\|', the compiler tries to reduce code size and execution
2165: time.
2166:
2167: When you specify `\|\c
2168: .B \-O\c
2169: \&\|', `\|\c
2170: .B \-fthread\-jumps\c
2171: \&\|' and
2172: `\|\c
2173: .B \-fdelayed\-branch\c
2174: \&\|' are turned on. On some machines other
2175: flags may also be turned on.
2176: .TP
2177: .B \-O2
2178: Highly optimize. As compared to `\|\c
2179: .B \-O\c
2180: \&\|', this
2181: option will increase both compilation time and the performance of the
2182: generated code.
2183:
2184: All `\|\c
2185: .B \-f\c
2186: .I flag\c
2187: \&\c
2188: \&\|' options that control optimization are turned on
2189: when you specify `\|\c
2190: .B \-O2\c
2191: \&\|', except `\|\c
2192: .B \-funroll\-loops\c
2193: \&\|'
2194: and `\|\c
2195: .B \-funroll\-all\-loops\c
2196: \&\|'.
2197: .PP
2198:
2199: Options of the form `\|\c
2200: .B \-f\c
2201: .I flag\c
2202: \&\c
2203: \&\|' specify machine-independent
2204: flags. Most flags have both positive and negative forms; the negative
2205: form of `\|\c
2206: .B \-ffoo\c
2207: \&\|' would be `\|\c
2208: .B \-fno\-foo\c
2209: \&\|'. The following list shows
2210: only one form\(em\&the one which is not the default.
2211: You can figure out the other form by either removing `\|\c
2212: .B no\-\c
2213: \&\|' or
2214: adding it.
2215: .TP
2216: .B \-ffloat\-store
2217: Do not store floating point variables in registers. This
2218: prevents undesirable excess precision on machines such as the
2219: 68000 where the floating registers (of the 68881) keep more
2220: precision than a \c
2221: .B double\c
2222: \& is supposed to have.
2223:
2224: For most programs, the excess precision does only good, but a few
2225: programs rely on the precise definition of IEEE floating point.
2226: Use `\|\c
2227: .B \-ffloat\-store\c
2228: \&\|' for such programs.
2229: .TP
2230: .B \-fmemoize\-lookups
2231: .TP
2232: .B \-fsave\-memoized
2233: .I
2234: (C++ only.)
2235: These flags are used to get the compiler to compile programs faster
2236: using heuristics. They are not on by default since they are only effective
2237: about half the time. The other half of the time programs compile more
2238: slowly (and take more memory).
2239:
2240: The first time the compiler must build a call to a member function (or
2241: reference to a data member), it must (1) determine whether the class
2242: implements member functions of that name; (2) resolve which member
2243: function to call (which involves figuring out what sorts of type
2244: conversions need to be made); and (3) check the visibility of the member
2245: function to the caller. All of this adds up to slower compilation.
2246: Normally, the second time a call is made to that member function (or
2247: reference to that data member), it must go through the same lengthy
2248: process again. This means that code like this
2249: .sp
2250: .br
2251: \ \ cout\ <<\ "This\ "\ <<\ p\ <<\ "\ has\ "\ <<\ n\ <<\ "\ legs.\en";
2252: .br
2253: .sp
2254: makes six passes through all three steps. By using a software cache,
2255: a ``hit'' significantly reduces this cost. Unfortunately, using the
2256: cache introduces another layer of mechanisms which must be implemented,
2257: and so incurs its own overhead. `\|\c
2258: .B \-fmemoize\-lookups\c
2259: \&\|' enables
2260: the software cache.
2261:
2262: Because access privileges (visibility) to members and member functions
2263: may differ from one function context to the next,
2264: .B g++
2265: may need to flush the cache. With the `\|\c
2266: .B \-fmemoize\-lookups\c
2267: \&\|' flag, the cache is flushed after every
2268: function that is compiled. The `\|\c
2269: \-fsave\-memoized\c
2270: \&\|' flag enables the same software cache, but when the compiler
2271: determines that the context of the last function compiled would yield
2272: the same access privileges of the next function to compile, it
2273: preserves the cache.
2274: This is most helpful when defining many member functions for the same
2275: class: with the exception of member functions which are friends of
2276: other classes, each member function has exactly the same access
2277: privileges as every other, and the cache need not be flushed.
2278: .TP
2279: .B \-fno\-default\-inline
2280: .I
2281: (C++ only.)
2282: If `\|\c
2283: .B \-fdefault\-inline\c
2284: \&\|' is enabled then member functions defined inside class
2285: scope are compiled inline by default; i.e., you don't need to
2286: add `\|\c
2287: .B inline\c
2288: \&\|' in front of the member function name. By popular
2289: demand, this option is now the default. To keep GNU C++ from inlining
2290: these member functions, specify `\|\c
2291: .B \-fno\-default\-inline\c
2292: \&\|'.
2293: .TP
2294: .B \-fno\-defer\-pop
2295: Always pop the arguments to each function call as soon as that
2296: function returns. For machines which must pop arguments after a
2297: function call, the compiler normally lets arguments accumulate on the
2298: stack for several function calls and pops them all at once.
2299: .TP
2300: .B \-fforce\-mem
2301: Force memory operands to be copied into registers before doing
2302: arithmetic on them. This may produce better code by making all
2303: memory references potential common subexpressions. When they are
2304: not common subexpressions, instruction combination should
2305: eliminate the separate register-load. I am interested in hearing
2306: about the difference this makes.
2307: .TP
2308: .B \-fforce\-addr
2309: Force memory address constants to be copied into registers before
2310: doing arithmetic on them. This may produce better code just as
2311: `\|\c
2312: .B \-fforce\-mem\c
2313: \&\|' may. I am interested in hearing about the
2314: difference this makes.
2315: .TP
2316: .B \-fomit\-frame\-pointer
2317: Don't keep the frame pointer in a register for functions that
2318: don't need one. This avoids the instructions to save, set up and
2319: restore frame pointers; it also makes an extra register available
2320: in many functions. \c
2321: .I It also makes debugging impossible on
2322: most machines.\c
2323: \&
2324:
2325: On some machines, such as the Vax, this flag has no effect, because
2326: the standard calling sequence automatically handles the frame pointer
2327: and nothing is saved by pretending it doesn't exist. The
2328: machine-description macro \c
2329: .B FRAME_POINTER_REQUIRED\c
2330: \& controls
2331: whether a target machine supports this flag.
2332: .TP
2333: .B \-finline
2334: Pay attention the \c
2335: .B inline\c
2336: \& keyword. Normally the negation of this
2337: option `\|\c
2338: .B \-fno\-inline\c
2339: \&\|' is used to keep the compiler from expanding
2340: any functions inline. However, the opposite effect may be desirable
2341: when compiling with `\|\c
2342: .B \-g\c
2343: \&\|', since `\|\c
2344: .B \-g\c
2345: \&\|' normally turns off all
2346: inline function expansion.
2347: .TP
2348: .B \-finline\-functions
2349: Integrate all simple functions into their callers. The compiler
2350: heuristically decides which functions are simple enough to be worth
2351: integrating in this way.
2352:
2353: If all calls to a given function are integrated, and the function is
2354: declared \c
2355: .B static\c
2356: \&, then GCC normally does not output the function as
2357: assembler code in its own right.
2358: .TP
2359: .B \-fcaller\-saves
2360: Enable values to be allocated in registers that will be clobbered by
2361: function calls, by emitting extra instructions to save and restore the
2362: registers around such calls. Such allocation is done only when it
2363: seems to result in better code than would otherwise be produced.
2364:
2365: This option is enabled by default on certain machines, usually those
2366: which have no call-preserved registers to use instead.
2367: .TP
2368: .B \-fkeep\-inline\-functions
2369: Even if all calls to a given function are integrated, and the function
2370: is declared \c
2371: .B static\c
2372: \&, nevertheless output a separate run-time
2373: callable version of the function.
2374: .TP
2375: .B \-fno\-function\-cse
2376: Do not put function addresses in registers; make each instruction that
2377: calls a constant function contain the function's address explicitly.
2378:
2379: This option results in less efficient code, but some strange hacks
2380: that alter the assembler output may be confused by the optimizations
2381: performed when this option is not used.
2382: .PP
2383:
2384: The following options control specific optimizations. The `\|\c
2385: .B \-O2\c
2386: \&\|'
2387: option turns on all of these optimizations except `\|\c
2388: .B \-funroll\-loops\c
2389: \&\|'
2390: and `\|\c
2391: .B \-funroll\-all\-loops\c
2392: \&\|'.
2393:
2394: The `\|\c
2395: .B \-O\c
2396: \&\|' option usually turns on
2397: the `\|\c
2398: .B \-fthread\-jumps\c
2399: \&\|' and `\|\c
2400: .B \-fdelayed\-branch\c
2401: \&\|' options, but
2402: specific machines may change the default optimizations.
2403:
2404: You can use the following flags in the rare cases when ``fine-tuning''
2405: of optimizations to be performed is desired.
2406: .TP
2407: .B \-fstrength\-reduce
2408: Perform the optimizations of loop strength reduction and
2409: elimination of iteration variables.
2410: .TP
2411: .B \-fthread\-jumps
2412: Perform optimizations where we check to see if a jump branches to a
2413: location where another comparison subsumed by the first is found. If
2414: so, the first branch is redirected to either the destination of the
2415: second branch or a point immediately following it, depending on whether
2416: the condition is known to be true or false.
2417: .TP
2418: .B \-funroll\-loops
2419: Perform the optimization of loop unrolling. This is only done for loops
2420: whose number of iterations can be determined at compile time or run time.
2421: .TP
2422: .B \-funroll\-all\-loops
2423: Perform the optimization of loop unrolling. This is done for all loops.
2424: This usually makes programs run more slowly.
2425: .TP
2426: .B \-fcse\-follow\-jumps
2427: In common subexpression elimination, scan through jump instructions in
2428: certain cases. This is not as powerful as completely global CSE, but
2429: not as slow either.
2430: .TP
2431: .B \-frerun\-cse\-after\-loop
2432: Re-run common subexpression elimination after loop optimizations has been
2433: performed.
2434: .TP
2435: .B \-felide\-constructors
2436: .I
2437: (C++ only.)
2438: Use this option to instruct the compiler to be smarter about when it can
2439: elide constructors. Without this flag, GNU C++ and cfront both
2440: generate effectively the same code for:
2441: .sp
2442: .br
2443: A\ foo\ ();
2444: .br
2445: A\ x\ (foo\ ());\ \ \ //\ x\ initialized\ by\ `foo\ ()',\ no\ ctor\ called
2446: .br
2447: A\ y\ =\ foo\ ();\ \ \ //\ call\ to\ `foo\ ()'\ heads\ to\ temporary,
2448: .br
2449: \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ y\ is\ initialized\ from\ the\ temporary.
2450: .br
2451: .sp
2452: Note the difference! With this flag, GNU C++ initializes `\|\c
2453: .B y\c
2454: \&\|' directly
2455: from the call to
2456: .B foo ()
2457: without going through a temporary.
2458: .TP
2459: .B \-fexpensive\-optimizations
2460: Perform a number of minor optimizations that are relatively expensive.
2461: .TP
2462: .B \-fdelayed\-branch
2463: If supported for the target machine, attempt to reorder instructions
2464: to exploit instruction slots available after delayed branch
2465: instructions.
2466: .TP
2467: .B \-fschedule\-insns
2468: If supported for the target machine, attempt to reorder instructions to
2469: eliminate execution stalls due to required data being unavailable. This
2470: helps machines that have slow floating point or memory load instructions
2471: by allowing other instructions to be issued until the result of the load
2472: or floating point instruction is required.
2473: .TP
2474: .B \-fschedule\-insns2
2475: Similar to `\|\c
2476: .B \-fschedule\-insns\c
2477: \&\|', but requests an additional pass of
2478: instruction scheduling after register allocation has been done. This is
2479: especially useful on machines with a relatively small number of
2480: registers and where memory load instructions take more than one cycle.
2481: .PP
2482:
2483: .SH TARGET OPTIONS
2484: By default, GNU CC compiles code for the same type of machine that you
2485: are using. However, it can also be installed as a cross-compiler, to
2486: compile for some other type of machine. In fact, several different
2487: configurations of GNU CC, for different target machines, can be
2488: installed side by side. Then you specify which one to use with the
2489: `\|\c
2490: .B \-b\c
2491: \&\|' option.
2492:
2493: In addition, older and newer versions of GNU CC can be installed side
2494: by side. One of them (probably the newest) will be the default, but
2495: you may sometimes wish to use another.
2496: .TP
2497: .BI "\-b " "machine"\c
2498: \&
2499: The argument \c
2500: .I machine\c
2501: \& specifies the target machine for compilation.
2502: This is useful when you have installed GNU CC as a cross-compiler.
2503:
2504: The value to use for \c
2505: .I machine\c
2506: \& is the same as was specified as the
2507: machine type when configuring GNU CC as a cross-compiler. For
2508: example, if a cross-compiler was configured with `\|\c
2509: .B configure
2510: i386v\c
2511: \&\|', meaning to compile for an 80386 running System V, then you
2512: would specify `\|\c
2513: .B \-b i386v\c
2514: \&\|' to run that cross compiler.
2515:
2516: When you do not specify `\|\c
2517: .B \-b\c
2518: \&\|', it normally means to compile for
2519: the same type of machine that you are using.
2520: .TP
2521: .BI "\-V " "version"\c
2522: \&
2523: The argument \c
2524: .I version\c
2525: \& specifies which version of GNU CC to run.
2526: This is useful when multiple versions are installed. For example,
2527: \c
2528: .I version\c
2529: \& might be `\|\c
2530: .B 2.0\c
2531: \&\|', meaning to run GNU CC version 2.0.
2532:
2533: The default version, when you do not specify `\|\c
2534: .B \-V\c
2535: \&\|', is controlled
2536: by the way GNU CC is installed. Normally, it will be a version that
2537: is recommended for general use.
2538: .PP
2539:
2540: .SH MACHINE DEPENDENT OPTIONS
2541: Each of the target machine types can have its own special options,
2542: starting with `\|\c
2543: .B \-m\c
2544: \&\|', to choose among various hardware models or
2545: configurations\(em\&for example, 68010 vs 68020, floating coprocessor or
2546: none. A single installed version of the compiler can compile for any
2547: model or configuration, according to the options specified.
2548:
2549: These are the `\|\c
2550: .B \-m\c
2551: \&\|' options defined for the 68000 series:
2552: .TP
2553: .B \-m68020
2554: .TP
2555: .B \-mc68020
2556: Generate output for a 68020 (rather than a 68000). This is the
2557: default if you use the unmodified sources.
2558: .TP
2559: .B \-m68000
2560: .TP
2561: .B \-mc68000
2562: Generate output for a 68000 (rather than a 68020).
2563: .TP
2564: .B \-m68881
2565: Generate output containing 68881 instructions for floating point.
2566: This is the default if you use the unmodified sources.
2567: .TP
2568: .B \-mfpa
2569: Generate output containing Sun FPA instructions for floating point.
2570: .TP
2571: .B \-msoft\-float
2572: Generate output containing library calls for floating point.
2573: .I
2574: WARNING:
2575: the requisite libraries are not part of GNU CC. Normally the
2576: facilities of the machine's usual C compiler are used, but this can't
2577: be done directly in cross-compilation. You must make your own
2578: arrangements to provide suitable library functions for cross-compilation.
2579: .TP
2580: .B \-mshort
2581: Consider type \c
2582: .B int\c
2583: \& to be 16 bits wide, like \c
2584: .B short int\c
2585: \&.
2586: .TP
2587: .B \-mnobitfield
2588: Do not use the bit-field instructions. `\|\c
2589: .B \-m68000\c
2590: \&\|' implies
2591: `\|\c
2592: .B \-mnobitfield\c
2593: \&\|'.
2594: .TP
2595: .B \-mbitfield
2596: Do use the bit-field instructions. `\|\c
2597: .B \-m68020\c
2598: \&\|' implies
2599: `\|\c
2600: .B \-mbitfield\c
2601: \&\|'. This is the default if you use the unmodified
2602: sources.
2603: .TP
2604: .B \-mrtd
2605: Use a different function-calling convention, in which functions
2606: that take a fixed number of arguments return with the \c
2607: .B rtd\c
2608: \&
2609: instruction, which pops their arguments while returning. This
2610: saves one instruction in the caller since there is no need to pop
2611: the arguments there.
2612:
2613: This calling convention is incompatible with the one normally
2614: used on Unix, so you cannot use it if you need to call libraries
2615: compiled with the Unix compiler.
2616:
2617: Also, you must provide function prototypes for all functions that
2618: take variable numbers of arguments (including \c
2619: .B printf\c
2620: \&);
2621: otherwise incorrect code will be generated for calls to those
2622: functions.
2623:
2624: In addition, seriously incorrect code will result if you call a
2625: function with too many arguments. (Normally, extra arguments are
2626: harmlessly ignored.)
2627:
2628: The \c
2629: .B rtd\c
2630: \& instruction is supported by the 68010 and 68020
2631: processors, but not by the 68000.
2632: .PP
2633:
2634: These `\|\c
2635: .B \-m\c
2636: \&\|' options are defined for the Vax:
2637: .TP
2638: .B \-munix
2639: Do not output certain jump instructions (\c
2640: .B aobleq\c
2641: \& and so on)
2642: that the Unix assembler for the Vax cannot handle across long
2643: ranges.
2644: .TP
2645: .B \-mgnu
2646: Do output those jump instructions, on the assumption that you
2647: will assemble with the GNU assembler.
2648: .TP
2649: .B \-mg
2650: Output code for g-format floating point numbers instead of d-format.
2651: .PP
2652:
2653: These `\|\c
2654: .B \-m\c
2655: \&\|' switches are supported on the Sparc:
2656: .TP
2657: .B \-mfpu
2658: Generate output containing floating point instructions. This is the
2659: default if you use the unmodified sources.
2660: .TP
2661: .B \-mno\-epilogue
2662: Generate separate return instructions for \c
2663: .B return\c
2664: \& statements.
2665: This has both advantages and disadvantages; I don't recall what they
2666: are.
2667: .PP
2668:
2669: These `\|\c
2670: .B \-m\c
2671: \&\|' options are defined for the Convex:
2672: .TP
2673: .B \-mc1
2674: Generate output for a C1. This is the default when the compiler is
2675: configured for a C1.
2676: .TP
2677: .B \-mc2
2678: Generate output for a C2. This is the default when the compiler is
2679: configured for a C2.
2680: .TP
2681: .B \-margcount
2682: Generate code which puts an argument count in the word preceding each
2683: argument list. Some nonportable Convex and Vax programs need this word.
2684: (Debuggers don't, except for functions with variable-length argument
2685: lists; this info is in the symbol table.)
2686: .TP
2687: .B \-mnoargcount
2688: Omit the argument count word. This is the default if you use the
2689: unmodified sources.
2690: .PP
2691:
2692: These `\|\c
2693: .B \-m\c
2694: \&\|' options are defined for the AMD Am29000:
2695: .TP
2696: .B \-mdw
2697: Generate code that assumes the DW bit is set, i.e., that byte and
2698: halfword operations are directly supported by the hardware. This is the
2699: default.
2700: .TP
2701: .B \-mnodw
2702: Generate code that assumes the DW bit is not set.
2703: .TP
2704: .B \-mbw
2705: Generate code that assumes the system supports byte and halfword write
2706: operations. This is the default.
2707: .TP
2708: .B \-mnbw
2709: Generate code that assumes the systems does not support byte and
2710: halfword write operations. This implies `\|\c
2711: .B \-mnodw\c
2712: \&\|'.
2713: .TP
2714: .B \-msmall
2715: Use a small memory model that assumes that all function addresses are
2716: either within a single 256 KB segment or at an absolute address of less
2717: than 256K. This allows the \c
2718: .B call\c
2719: \& instruction to be used instead
2720: of a \c
2721: .B const\c
2722: \&, \c
2723: .B consth\c
2724: \&, \c
2725: .B calli\c
2726: \& sequence.
2727: .TP
2728: .B \-mlarge
2729: Do not assume that the \c
2730: .B call\c
2731: \& instruction can be used; this is the
2732: default.
2733: .TP
2734: .B \-m29050
2735: Generate code for the Am29050.
2736: .TP
2737: .B \-m29000
2738: Generate code for the Am29000. This is the default.
2739: .TP
2740: .B \-mkernel\-registers
2741: Generate references to registers \c
2742: .B gr64-gr95\c
2743: \& instead of
2744: \c
2745: .B gr96-gr127\c
2746: \&. This option can be used when compiling kernel code
2747: that wants a set of global registers disjoint from that used by
2748: user-mode code.
2749:
2750: Note that when this option is used, register names in `\|\c
2751: .B \-f\c
2752: \&\|' flags
2753: must use the normal, user-mode, names.
2754: .TP
2755: .B \-muser\-registers
2756: Use the normal set of global registers, \c
2757: .B gr96-gr127\c
2758: \&. This is the
2759: default.
2760: .TP
2761: .B \-mstack\-check
2762: Insert a call to \c
2763: .B __msp_check\c
2764: \& after each stack adjustment. This
2765: is often used for kernel code.
2766: .PP
2767:
2768: These `\|\c
2769: .B \-m\c
2770: \&\|' options are defined for Motorola 88K architectures:
2771: .TP
2772: .B \-mbig\-pic
2773: Emit position-independent code, suitable for dynamic linking, even if
2774: branches need large displacements. Equivalent to the general-use option `\|\c
2775: .B \-fPIC\c
2776: \&\|'.
2777: The general-use option `\|\c
2778: .B \-fpic\c
2779: \&\|',
2780: by contrast, only emits valid 88k code if all branches involve small
2781: displacements.
2782: GCC does not emit position-independent code by default.
2783: .TP
2784: .B \-midentify\-revision
2785: Include an \c
2786: .B ident\c
2787: \& directive in the assembler output recording the
2788: source file name, compiler name and version, timestamp, and compilation
2789: flags used.
2790: .TP
2791: .B \-mno\-underscores
2792: In assembler output, emit symbol names without adding an underscore
2793: character at the beginning of each name. The default is to use an
2794: underscore as prefix on each name.
2795: .TP
2796: .B \-mno\-check\-zero\-division
2797: .TP
2798: .B \-mcheck\-zero\-division
2799: Early models of the 88K architecture had problems with division by zero;
2800: in particular, many of them didn't trap. Use these options to avoid
2801: including (or to include explicitly) additional code to detect division
2802: by zero and signal an exception. All GCC configurations for the 88K use
2803: `\|\c
2804: .B \-mcheck\-zero\-division\c
2805: \&\|' by default.
2806: .TP
2807: .B \-mocs\-debug\-info
2808: .TP
2809: .B \-mno\-ocs\-debug\-info
2810: Include (or omit) additional debugging information (about
2811: registers used in each stack frame) as specified in the 88Open Object
2812: Compatibility Standard, ``OCS''. This extra information is not needed
2813: by GDB. The default for DG/UX, SVr4, and Delta 88 SVr3.2 is to
2814: include this information; other 88k configurations omit this information
2815: by default.
2816: .TP
2817: .B \-mocs\-frame\-position
2818: .TP
2819: .B \-mno\-ocs\-frame\-position
2820: Force (or do not require) register values to be stored in a particular
2821: place in stack frames, as specified in OCS. The DG/UX, Delta88 SVr3.2,
2822: and BCS configurations use `\|\c
2823: .B \-mocs\-frame\-position\c
2824: \&\|'; other 88k
2825: configurations have the default `\|\c
2826: .B \-mno\-ocs\-frame\-position\c
2827: \&\|'.
2828: .TP
2829: .B \-moptimize\-arg\-area
2830: .TP
2831: .B \-mno\-optimize\-arg\-area
2832: Control how to store function arguments in stack frames.
2833: `\|\c
2834: .B \-moptimize\-arg\-area\c
2835: \&\|' saves space, but may break some
2836: debuggers (not GDB). `\|\c
2837: .B \-mno\-optimize\-arg\-area\c
2838: \&\|' conforms better to
2839: standards. By default GCC does not optimize the argument area.
2840: .TP
2841: .BI "\-mshort\-data\-" "num"\c
2842: \&
2843: .I num\c
2844: \&
2845: Generate smaller data references by making them relative to \c
2846: .B r0\c
2847: \&,
2848: which allows loading a value using a single instruction (rather than the
2849: usual two). You control which data references are affected by
2850: specifying \c
2851: .I num\c
2852: \& with this option. For example, if you specify
2853: `\|\c
2854: .B \-mshort\-data\-512\c
2855: \&\|', then the data references affected are those
2856: involving displacements of less than 512 bytes.
2857: `\|\c
2858: .B \-mshort\-data\-\c
2859: .I num\c
2860: \&\c
2861: \&\|' is not effective for \c
2862: .I num\c
2863: \& greater
2864: than 64K.
2865: .TP
2866: .B \-msvr4
2867: .TP
2868: .B \-msvr3
2869: Turn on (`\|\c
2870: .B \-msvr4\c
2871: \&\|') or off (`\|\c
2872: .B \-msvr3\c
2873: \&\|') compiler extensions
2874: related to System V release 4 (SVr4). This controls the following:
2875: .TP
2876: \ \ \ \(bu
2877: Which variant of the assembler syntax to emit (which you can select
2878: independently using `\|\c
2879: .B \-mversion03.00\c
2880: \&\|').
2881: .TP
2882: \ \ \ \(bu
2883: `\|\c
2884: .B \-msvr4\c
2885: \&\|' makes the C preprocessor recognize `\|\c
2886: .B #pragma weak\c
2887: \&\|'
2888: .TP
2889: \ \ \ \(bu
2890: `\|\c
2891: .B \-msvr4\c
2892: \&\|' makes GCC issue additional declaration directives used in
2893: SVr4.
2894: .PP
2895: `\|\c
2896: .B \-msvr3\c
2897: \&\|' is the default for all m88K configurations except
2898: the SVr4 configuration.
2899: .TP
2900: .B \-mtrap\-large\-shift
2901: .TP
2902: .B \-mhandle\-large\-shift
2903: Include code to detect bit-shifts of more than 31 bits; respectively,
2904: trap such shifts or emit code to handle them properly. By default GCC
2905: makes no special provision for large bit shifts.
2906: .TP
2907: .B \-muse\-div\-instruction
2908: Very early models of the 88K architecture didn't have a divide
2909: instruction, so GCC avoids that instruction by default. Use this option
2910: to specify that it's safe to use the divide instruction.
2911: .TP
2912: .B \-mversion\-03.00
2913: Use alternative assembler syntax for the assembler version corresponding
2914: to SVr4, but without enabling the other features triggered by
2915: `\|\c
2916: .B \-svr4\c
2917: \&\|'. This is implied by `\|\c
2918: .B \-svr4\c
2919: \&\|', is the default for the
2920: SVr4 configuration of GCC, and is permitted by the DG/UX configuration
2921: only if `\|\c
2922: .B \-svr4\c
2923: \&\|' is also specified. The Delta 88 SVr3.2
2924: configuration ignores this option.
2925: .TP
2926: .B \-mwarn\-passed\-structs
2927: Warn when a function passes a struct as an argument or result.
2928: Structure-passing conventions have changed during the evolution of the C
2929: language, and are often the source of portability problems. By default,
2930: GCC issues no such warning.
2931: .PP
2932: These options are defined for the IBM RS6000:
2933:
2934: .PP
2935: .B \-mfp\-in\-toc
2936: .TP
2937: .B \-mno\-fp\-in\-toc
2938: Control whether or not floating-point constants go in the Table of
2939: Contents (TOC), a table of all global variable and function addresses. By
2940: default GCC puts floating-point constants there; if the TOC overflows,
2941: `\|\c
2942: .B \-mno\-fp\-in\-toc\c
2943: \&\|' will reduce the size of the TOC, which may avoid
2944: the overflow.
2945:
2946: .PP
2947: These `\|\c
2948: .B \-m\c
2949: \&\|' options are defined for the IBM RT PC:
2950: .TP
2951: .B \-min\-line\-mul
2952: Use an in-line code sequence for integer multiplies. This is the
2953: default.
2954: .TP
2955: .B \-mcall\-lib\-mul
2956: Call \c
2957: .B lmul$$\c
2958: \& for integer multiples.
2959: .TP
2960: .B \-mfull\-fp\-blocks
2961: Generate full-size floating point data blocks, including the minimum
2962: amount of scratch space recommended by IBM. This is the default.
2963: .TP
2964: .B \-mminimum\-fp\-blocks
2965: Do not include extra scratch space in floating point data blocks. This
2966: results in smaller code, but slower execution, since scratch space must
2967: be allocated dynamically.
2968: .TP
2969: .B \-mfp\-arg\-in\-fpregs
2970: Use a calling sequence incompatible with the IBM calling convention in
2971: which floating point arguments are passed in floating point registers.
2972: Note that \c
2973: .B varargs.h\c
2974: \& and \c
2975: .B stdargs.h\c
2976: \& will not work with
2977: floating point operands if this option is specified.
2978: .TP
2979: .B \-mfp\-arg\-in\-gregs
2980: Use the normal calling convention for floating point arguments. This is
2981: the default.
2982: .TP
2983: .B \-mhc\-struct\-return
2984: Return structures of more than one word in memory, rather than in a
2985: register. This provides compatibility with the MetaWare HighC (hc)
2986: compiler. Use `\|\c
2987: .B \-fpcc\-struct\-return\c
2988: \&\|' for compatibility with the
2989: Portable C Compiler (pcc).
2990: .TP
2991: .B \-mnohc\-struct\-return
2992: Return some structures of more than one word in registers, when
2993: convenient. This is the default. For compatibility with the
2994: IBM-supplied compilers, use either `\|\c
2995: .B \-fpcc\-struct\-return\c
2996: \&\|' or
2997: `\|\c
2998: .B \-mhc\-struct\-return\c
2999: \&\|'.
3000: .PP
3001: These `\|\c
3002: .B \-m\c
3003: \&\|' options are defined for the MIPS family of computers:
3004: .TP
3005: .BI "\-mcpu=" "cpu-type"
3006: Assume the defaults for the machine type
3007: .I cpu-type
3008: when
3009: scheduling insturctions. The default
3010: .I cpu-type
3011: is
3012: .BR default ,
3013: which picks the longest cycles times for any of the machines, in order
3014: that the code run at reasonable rates on all MIPS cpu's. Other
3015: choices for
3016: .I cpu-type
3017: are
3018: .BR r2000 ,
3019: .BR r3000 ,
3020: .BR r4000 ,
3021: and
3022: .BR r6000 .
3023: While picking a specific
3024: .I cpu-type
3025: will schedule things appropriately for that particular chip, the
3026: compiler will not generate any code that does not meet level 1 of the
3027: MIPS ISA (instruction set architecture) without the
3028: .B \-mips2
3029: or
3030: .B \-mips3
3031: switches being used.
3032: .TP
3033: .B \-mips2
3034: Issue instructions from level 2 of the MIPS ISA (branch likely, square
3035: root instructions). The
3036: .B \-mcpu=r4000
3037: or
3038: .B \-mcpu=r6000
3039: switch must be used in conjuction with
3040: .BR \-mips2 .
3041: .TP
3042: .B \-mips3
3043: Issue instructions from level 3 of the MIPS ISA (64 bit instructions).
3044: The
3045: .B \-mcpu=r4000
3046: switch must be used in conjuction with
3047: .BR \-mips2 .
3048: .TP
3049: .B \-mint64
3050: .TP
3051: .B \-mlong64
3052: .TP
3053: .B \-mlonglong128
3054: These options don't work at present.
3055: .TP
3056: .B \-mmips\-as
3057: Generate code for the MIPS assembler, and invoke
3058: .B mips\-tfile
3059: to add normal debug information. This is the default for all
3060: platforms except for the OSF/1 reference platform, using the OSF/rose
3061: object format. If the any of the
3062: .BR \-ggdb ,
3063: .BR \-gstabs ,
3064: or
3065: .B \-gstabs+
3066: switches are used, the
3067: .B mips\-tfile
3068: program will encapsulate the stabs within MIPS ECOFF.
3069: .TP
3070: .B \-mgas
3071: Generate code for the GNU assembler. This is the default on the OSF/1
3072: reference platform, using the OSF/rose object format.
3073: .TP
3074: .B \-mrnames
3075: .TP
3076: .B \-mno\-rnames
3077: The
3078: .B \-mrnames
3079: switch says to output code using the MIPS software names for the
3080: registers, instead of the hardware names (ie,
3081: .B a0
3082: instead of
3083: .BR $4 ).
3084: The GNU assembler does not support the
3085: .B \-mrnames
3086: switch, and the MIPS assembler will be instructed to run the MIPS C
3087: preprocessor over the source file. The
3088: .B \-mno\-rnames
3089: switch is default.
3090: .TP
3091: .B \-mgpopt
3092: .TP
3093: .B \-mno\-gpopt
3094: The
3095: .B \-mgpopt
3096: switch says to write all of the data declarations before the
3097: instructions in the text section, to all the MIPS assembler to
3098: generate one word memory references instead of using two words for
3099: short global or static data items. This is on by default if
3100: optimization is selected.
3101: .TP
3102: .B \-mstats
3103: .TP
3104: .B \-mno\-stats
3105: For each non-inline function processed, the
3106: .B \-mstats
3107: switch causes the compiler to emit one line to the standard error file
3108: to print statistics about the program (number of registers saved,
3109: stack size, etc.).
3110: .TP
3111: .B \-mmemcpy
3112: .TP
3113: .B \-mno\-memcpy
3114: The
3115: .B \-mmemcpy
3116: switch makes all block moves call the appropriate string function
3117: .RB ( memcpy
3118: or
3119: .BR bcopy )
3120: instead of possibly generating inline code.
3121: .TP
3122: .B \-mmips\-tfile
3123: .TP
3124: .B \-mno\-mips\-tfile
3125: The
3126: .B \-mno\-mips\-tfile
3127: switch causes the compiler not postprocess the object file with the
3128: .B mips\-tfile
3129: program, after the MIPS assembler has generated it to add debug
3130: support. If
3131: .B mips\-tfile
3132: is not run, then no local variables will be available to the debugger.
3133: In addition,
3134: .B stage2
3135: and
3136: .B stage3
3137: objects will have the temporary file names passed to the assembler
3138: embedded in the object file, which means the objects will not compare
3139: the same.
3140: .TP
3141: .B \-msoft\-float
3142: Generate output containing library calls for floating point.
3143: .I
3144: WARNING:
3145: the requisite libraries are not part of GNU CC. Normally the
3146: facilities of the machine's usual C compiler are used, but this can't
3147: be done directly in cross-compilation. You must make your own
3148: arrangements to provide suitable library functions for cross-compilation.
3149: .TP
3150: .B \-mhard\-float
3151: Generate output containing floating point instructions. This is the
3152: default if you use the unmodified sources.
3153: .TP
3154: .B \-mfp64
3155: Assume that the
3156: .B FR
3157: bit in the status word is on, and that there are 32 64-bit floating
3158: point registers, instead of 32 32-bit floating point registers. You
3159: must also specify the
3160: .B \-mcpu=r4000
3161: and
3162: .B \-mips3
3163: switches.
3164: .TP
3165: .B \-mfp32
3166: Assume that there are 32 32-bit floating point registers. This is the
3167: default.
3168: .TP
3169: .B \-mabicalls
3170: The
3171: .B \-mabicalls
3172: switch says to emit the
3173: .BR \&.abicalls ,
3174: .BR \&.cpload ,
3175: and
3176: .B \&.cprestore
3177: pseudo operations that some System V.4 ports use for position
3178: independent code.
3179: .TP
3180: .B \-mhalf\-pic
3181: .TP
3182: .B \-mno\-half\-pic
3183: The
3184: .B \-mhalf\-pic
3185: switch says to put pointers to extern references into the data section
3186: and load them up, rather than put the references in the text section.
3187: This option does not work at present.
3188: .B
3189: .BI \-G num
3190: Put global and static items less than or equal to
3191: .I num
3192: bytes into the small data or bss sections instead of the normal data
3193: or bss section. This allows the assembler to emit one word memory
3194: reference instructions based on the global pointer
3195: .RB ( gp
3196: or
3197: .BR $28 ),
3198: instead of the normal two words used. By default,
3199: .I num
3200: is 8 when the MIPS assembler is used, and 0 when the GNU
3201: assembler is used. The
3202: .BI \-G num
3203: switch is also passed to the assembler and linker. All modules should
3204: be compiled with the same
3205: .BI \-G num
3206: value.
3207: .PP
3208:
3209: .SH CODE GENERATION OPTIONS
3210: These machine-independent options control the interface conventions
3211: used in code generation.
3212:
3213: Most of them begin with `\|\c
3214: \-f\c
3215: \&\|'. These options have both positive and negative forms; the negative form
3216: of `\|\c
3217: .B \-ffoo\c
3218: \&\|' would be `\|\c
3219: .B \-fno\-foo\c
3220: \&\|'. In the table below, only
3221: one of the forms is listed\(em\&the one which is not the default. You
3222: can figure out the other form by either removing `\|\c
3223: .B no\-\c
3224: \&\|' or adding
3225: it.
3226: .TP
3227: .BI +e N
3228: .I (C++ only.)
3229: control whether virtual function definitions in classes
3230: are used to generate code, or only to define interfaces for their
3231: callers. These options are provided for compatibility with cfront
3232: 1.x usage; the recommended GNU C++ usage is to use
3233: .B #pragma interface
3234: and
3235: .B
3236: #pragma implementation\c
3237: \&, instead.
3238:
3239: With `\|\c
3240: .B +e0\c
3241: \&\|', virtual function definitions in classes are declared extern;
3242: the declaration is used only as an interface specification, not to
3243: generate code for the virtual functions (in this compilation).
3244:
3245: With `\|\c
3246: .B +e1\c
3247: \&\|',
3248: .B g++
3249: actually generates the code implementing virtual functions
3250: defined in the code, and makes them publicly visible.
3251: .TP
3252: .B \-fnonnull\-objects
3253: .I
3254: (C++ only.)
3255: Normally, GNU C++ makes conservative assumptions about objects reached
3256: through references. For example, the compiler must check that `\|\c
3257: .B a\c
3258: \&\|' is not null in code like the following:
3259: .br
3260: \ \ \ \ obj\ &a\ =\ g\ ();
3261: .br
3262: \ \ \ \ a.f\ (2);
3263: .br
3264: Checking that references of this sort have non-null values requires
3265: extra code, however, and it is unnecessary for many programs. You can
3266: use `\|\c
3267: .B \-fnonnull\-objects\c
3268: \&\|' to omit the checks for null, if your program doesn't require the
3269: default checking.
3270: .TP
3271: .B \-fpcc\-struct\-return
3272: Use the same convention for returning \c
3273: .B struct\c
3274: \& and \c
3275: .B union\c
3276: \&
3277: values that is used by the usual C compiler on your system. This
3278: convention is less efficient for small structures, and on many
3279: machines it fails to be reentrant; but it has the advantage of
3280: allowing intercallability between GCC-compiled code and PCC-compiled
3281: code.
3282: .TP
3283: .B \-fshort\-enums
3284: Allocate to an \c
3285: .B enum\c
3286: \& type only as many bytes as it needs for the
3287: declared range of possible values. Specifically, the \c
3288: .B enum\c
3289: \& type
3290: will be equivalent to the smallest integer type which has enough room.
3291: .TP
3292: .B \-fshort\-double
3293: Use the same size for
3294: .B double
3295: as for
3296: .B float
3297: \&.
3298: .TP
3299: .B \-fshared\-data
3300: Requests that the data and non-\c
3301: .B const\c
3302: \& variables of this
3303: compilation be shared data rather than private data. The distinction
3304: makes sense only on certain operating systems, where shared data is
3305: shared between processes running the same program, while private data
3306: exists in one copy per process.
3307: .TP
3308: .B \-fno\-common
3309: Allocate even uninitialized global variables in the bss section of the
3310: object file, rather than generating them as common blocks. This has the
3311: effect that if the same variable is declared (without \c
3312: .B extern\c
3313: \&) in
3314: two different compilations, you will get an error when you link them.
3315: The only reason this might be useful is if you wish to verify that the
3316: program will work on other systems which always work this way.
3317: .TP
3318: .B \-fvolatile
3319: Consider all memory references through pointers to be volatile.
3320: .TP
3321: .B \-fpic
3322: If supported for the target machines, generate position-independent code,
3323: suitable for use in a shared library.
3324: .TP
3325: .B \-fPIC
3326: If supported for the target machine, emit position-independent code,
3327: suitable for dynamic linking, even if branches need large displacements.
3328: .TP
3329: .BI "\-ffixed\-" "reg"\c
3330: \&
3331: Treat the register named \c
3332: .I reg\c
3333: \& as a fixed register; generated code
3334: should never refer to it (except perhaps as a stack pointer, frame
3335: pointer or in some other fixed role).
3336:
3337: \c
3338: .I reg\c
3339: \& must be the name of a register. The register names accepted
3340: are machine-specific and are defined in the \c
3341: .B REGISTER_NAMES\c
3342: \&
3343: macro in the machine description macro file.
3344:
3345: This flag does not have a negative form, because it specifies a
3346: three-way choice.
3347: .TP
3348: .BI "\-fcall\-used\-" "reg"\c
3349: \&
3350: Treat the register named \c
3351: .I reg\c
3352: \& as an allocatable register that is
3353: clobbered by function calls. It may be allocated for temporaries or
3354: variables that do not live across a call. Functions compiled this way
3355: will not save and restore the register \c
3356: .I reg\c
3357: \&.
3358:
3359: Use of this flag for a register that has a fixed pervasive role in the
3360: machine's execution model, such as the stack pointer or frame pointer,
3361: will produce disastrous results.
3362:
3363: This flag does not have a negative form, because it specifies a
3364: three-way choice.
3365: .TP
3366: .BI "\-fcall\-saved\-" "reg"\c
3367: \&
3368: Treat the register named \c
3369: .I reg\c
3370: \& as an allocatable register saved by
3371: functions. It may be allocated even for temporaries or variables that
3372: live across a call. Functions compiled this way will save and restore
3373: the register \c
3374: .I reg\c
3375: \& if they use it.
3376:
3377: Use of this flag for a register that has a fixed pervasive role in the
3378: machine's execution model, such as the stack pointer or frame pointer,
3379: will produce disastrous results.
3380:
3381: A different sort of disaster will result from the use of this flag for
3382: a register in which function values may be returned.
3383:
3384: This flag does not have a negative form, because it specifies a
3385: three-way choice.
3386: .TP
3387: .B \-fgnu\-binutils
3388: .TP
3389: .B \-fno\-gnu\-binutils
3390: .I
3391: (C++ only.)
3392: `\|\c
3393: .B \-fgnu\-binutils
3394: \&\|' (the default for most, but not all, platforms) makes GNU C++
3395: emit extra information for static initialization and finalization.
3396: This information has to be passed from the assembler to the GNU
3397: linker. Some assemblers won't pass this information; you must either
3398: use GNU
3399: .B as
3400: or specify the option `\|\c
3401: .B \-fno\-gnu\-binutils\c
3402: \&\|'.
3403:
3404: With `\|\c
3405: .B \-fno\-gnu\-binutils\c
3406: \&\|', you must use the program
3407: .B collect
3408: (part of the GCC distribution) for linking.
3409: .PP
3410:
3411: .SH PRAGMAS
3412: Two `\|\c
3413: .B #pragma\c
3414: \&\|' directives are supported for GNU C++, to permit using the same
3415: header file for two purposes: as a definition of interfaces to a given
3416: object class, and as the full definition of the contents of that object class.
3417: .TP
3418: .B #pragma interface
3419: .I (C++ only.)
3420: Use this directive in header files that define object classes, to save
3421: space in most of the object files that use those classes. Normally,
3422: local copies of certain information (backup copies of inline member
3423: functions, debugging information, and the internal tables that
3424: implement virtual functions) must be kept in each object file that
3425: includes class definitions. You can use this pragma to avoid such
3426: duplication. When a header file containing `\|\c
3427: .B #pragma interface\c
3428: \&\|' is included in a compilation, this auxiliary information
3429: will not be generated (unless the main input source file itself uses
3430: `\|\c
3431: .B #pragma implementation\c
3432: \&\|'). Instead, the object files will contain references to be
3433: resolved at link time.
3434: .tr !"
3435: .TP
3436: .B #pragma implementation
3437: .TP
3438: .BI "#pragma implementation !" objects .h!
3439: .I (C++ only.)
3440: Use this pragma in a main input file, when you want full output from
3441: included header files to be generated (and made globally visible).
3442: The included header file, in turn, should use `\|\c
3443: .B #pragma interface\c
3444: \&\|'.
3445: Backup copies of inline member functions, debugging information, and
3446: the internal tables used to implement virtual functions are all
3447: generated in implementation files.
3448:
3449: If you use `\|\c
3450: .B #pragma implementation\c
3451: \&\|' with no argument, it applies to an include file with the same
3452: basename as your source file; for example, in `\|\c
3453: .B allclass.cc\c
3454: \&\|', `\|\c
3455: .B #pragma implementation\c
3456: \&\|' by itself is equivalent to `\|\c
3457: .B
3458: #pragma implementation "allclass.h"\c
3459: \&\|'. Use the string argument if you want a single implementation
3460: file to include code from multiple header files.
3461:
3462: There is no way to split up the contents of a single header file into
3463: multiple implementation files.
3464: .SH FILES
3465: .ta \w'LIBDIR/g++\-include 'u
3466: file.c C source file
3467: .br
3468: file.h C header (preprocessor) file
3469: .br
3470: file.i preprocessed C source file
3471: .br
3472: file.C C++ source file
3473: .br
3474: file.cc C++ source file
3475: .br
3476: file.cxx C++ source file
3477: .br
3478: file.m Objective-C source file
3479: .br
3480: file.s assembly language file
3481: .br
3482: file.o object file
3483: .br
3484: a.out link edited output
3485: .br
3486: \fITMPDIR\fR/cc\(** temporary files
3487: .br
3488: \fILIBDIR\fR/cpp preprocessor
3489: .br
3490: \fILIBDIR\fR/cc1 compiler for C
3491: .br
3492: \fILIBDIR\fR/cc1plus compiler for C++
3493: .br
3494: \fILIBDIR\fR/collect linker front end needed on some machines
3495: .br
3496: \fILIBDIR\fR/libgcc.a GCC subroutine library
3497: .br
3498: /lib/crt[01n].o start-up routine
3499: .br
3500: \fILIBDIR\fR/ccrt0 additional start-up routine for C++
3501: .br
3502: /lib/libc.a standard C library, see
3503: .IR intro (3)
3504: .br
3505: /usr/include standard directory for
3506: .B #include
3507: files
3508: .br
3509: \fILIBDIR\fR/include standard gcc directory for
3510: .B #include
3511: files
3512: .br
3513: \fILIBDIR\fR/g++\-include additional g++ directory for
3514: .B #include
3515: .sp
3516: .I LIBDIR
3517: is usually
3518: .B /usr/local/lib/\c
3519: .IR machine / version .
3520: .br
3521: .I TMPDIR
3522: comes from the environment variable
3523: .B TMPDIR
3524: (default
3525: .B /usr/tmp
3526: if available, else
3527: .B /tmp\c
3528: \&).
3529: .SH "SEE ALSO"
3530: cpp(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1).
3531: .br
3532: .RB "`\|" gcc "\|', `\|" cpp \|',
3533: .RB `\| as \|', `\| ld \|',
3534: and
3535: .RB `\| gdb \|'
3536: entries in
3537: .B info\c
3538: \&.
3539: .br
3540: .I
3541: Using and Porting GNU CC (for version 2.0)\c
3542: , Richard M. Stallman, November 1990;
3543: .I
3544: The C Preprocessor\c
3545: , Richard M. Stallman, July 1990;
3546: .I
3547: Using GDB: A Guide to the GNU Source-Level Debugger\c
3548: , Richard M. Stallman and Roland H. Pesch, December 1991;
3549: .I
3550: Using as: the GNU Assembler\c
3551: , Dean Elsner, Jay Fenlason & friends, March 1991;
3552: .I
3553: gld: the GNU linker\c
3554: , Steve Chamberlain and Roland Pesch, April 1991.
3555:
3556: .SH BUGS
3557: Report bugs to
3558: .BR bug\[email protected] .
3559: Bugs tend actually to be fixed if they can be isolated, so it is in your
3560: interest to report them in such a way that they can be easily reproduced.
3561: .SH COPYING
3562: Copyright (c) 1991 Free Software Foundation, Inc.
3563: .PP
3564: Permission is granted to make and distribute verbatim copies of
3565: this manual provided the copyright notice and this permission notice
3566: are preserved on all copies.
3567: .PP
3568: Permission is granted to copy and distribute modified versions of this
3569: manual under the conditions for verbatim copying, provided that the
3570: entire resulting derived work is distributed under the terms of a
3571: permission notice identical to this one.
3572: .PP
3573: Permission is granted to copy and distribute translations of this
3574: manual into another language, under the above conditions for modified
3575: versions, except that this permission notice may be included in
3576: translations approved by the Free Software Foundation instead of in
3577: the original English.
3578: .SH AUTHORS
3579: See the GNU CC Manual for the contributors to GNU CC.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.