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