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