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