1 .\" Copyright (c) 1991, 1992, 1993, 1994, 2000 Free Software Foundation -*-Text-*-
2 .\" See section COPYING for conditions for redistribution
4 .\" Set up \*(lq, \*(rq if -man hasn't already set it up.
8 . if !@@\(lq@ .ds lq "\(lq
13 . if !@@\(rq@ .ds rq "\(rq
23 .Id $Id: gcc.1,v 1.14 2000/04/11 06:01:52 loewis Exp $
24 .TH GCC 1 "\*(Dt" "GNU Tools" "GNU Tools"
26 gcc, g++ \- GNU project C and C++ Compiler (gcc-2.96)
29 .RI "[ " option " | " filename " ].\|.\|."
32 .RI "[ " option " | " filename " ].\|.\|."
34 The information in this man page is an extract from the full
35 documentation of the GNU C compiler, and is limited to the meaning of
38 This man page is not kept up to date except when volunteers want to
39 maintain it. If you find a discrepancy between the man page and the
40 software, please check the Info file, which is the authoritative
43 If we find that the things in this man page that are out of date cause
44 significant confusion or complaints, we will stop distributing the man
45 page. The alternative, updating the man page when we update the Info
46 file, is impossible because the rest of the work of maintaining GNU CC
47 leaves us no time for that. The GNU project regards man pages as
48 obsolete and should not let them take time away from other things.
50 For complete and current documentation, refer to the Info file `\|\c
54 Using and Porting GNU CC (for version 2.0)\c
55 \&. Both are made from the Texinfo source file
58 The C and C++ compilers are integrated. Both process input files
59 through one or more of four stages: preprocessing, compilation,
60 assembly, and linking. Source filename suffixes identify the source
61 language, but which name you use for the compiler governs default
65 assumes preprocessed (\c
67 \&) files are C and assumes C style linking.
70 assumes preprocessed (\c
72 \&) files are C++ and assumes C++ style linking.
74 Suffixes of source file names indicate the language and kind of
75 processing to be done:
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
91 Files with other suffixes are passed to the linker. Common cases include:
94 \&\fB.o\fP Object file
95 \&\fB.a\fP Archive file
99 Linking is always the last stage unless you use one of the
104 options to avoid it (or unless compilation errors stop the whole
105 process). For the link stage, all
107 files corresponding to source files,
109 libraries, unrecognized filenames (including named
114 are passed to the linker in command-line order.
116 Options must be separate: `\|\c
118 \&\|' is quite different from `\|\c
126 \&\|' options have two contrary forms:
134 \&). Only the non-default forms are shown here.
136 Here is a summary of all the options, grouped by type. Explanations are
137 in the following sections.
154 \-fdollars\-in\-identifiers
155 \-fexternal\-templates
162 \-fno\-strict\-prototype
165 \-funsigned\-bitfields
187 .RI \-Wid\-clash\- len
190 \-Wimplicit\-function\-declaration
194 \-Wmissing\-prototypes
195 \-Wmissing\-declarations
203 \-Wstrict\-prototypes
233 .RI \-print\-file\-name= library
234 \-print\-libgcc\-file\-name
235 .RI \-print\-prog\-name= program
237 .B Optimization Options
239 \-fcse\-follow\-jumps
242 \-felide\-constructors
243 \-fexpensive\-optimizations
249 \-fkeep\-inline\-functions
251 \-fno\-default\-inline
256 \-fomit\-frame\-pointer
257 \-frerun\-cse\-after\-loop
262 \-funroll\-all\-loops
268 .B Preprocessor Options
274 .RI \-D macro [\|= defn \|]
277 .RI "\-idirafter " dir
278 .RI "\-include " file
279 .RI "\-imacros " file
280 .RI "\-iprefix " file
281 .RI "\-iwithprefix " dir
301 .RI "\-Xlinker\ " option
315 .B Configuration Dependent Options
379 \-mcheck\-zero\-division
380 \-mhandle\-large\-shift
381 \-midentify\-revision
382 \-mno\-check\-zero\-division
383 \-mno\-ocs\-debug\-info
384 \-mno\-ocs\-frame\-position
385 \-mno\-optimize\-arg\-area
386 \-mno\-serialize\-volatile
389 \-mocs\-frame\-position
390 \-moptimize\-arg\-area
391 \-mserialize\-volatile
392 .RI \-mshort\-data\- num
395 \-mtrap\-large\-shift
396 \-muse\-div\-instruction
398 \-mwarn\-passed\-structs
408 \-mfp\-arg\-in\-fpregs
409 \-mfp\-arg\-in\-gregs
411 \-mhc\-struct\-return
413 \-mminimum\-fp\-blocks
414 \-mnohc\-struct\-return
418 \-mcpu=\fIcpu type\fP
450 \-mno\-fp\-ret\-in\-387
468 \-mno\-leaf\-procedures
500 .B Code Generation Options
501 .RI \-fcall\-saved\- reg
502 .RI \-fcall\-used\- reg
504 \-finhibit\-size\-directive
509 \-fpcc\-struct\-return
512 \-freg\-struct\-return
523 .BI "\-x " "language"
524 Specify explicitly the
526 \& for the following input files (rather than choosing a default based
527 on the file name suffix) . This option applies to all following input
528 files until the next `\|\c
530 \&\|' option. Possible values of \c
547 .B assembler\-with\-cpp\c
551 Turn off any specification of a language, so that subsequent files are
552 handled according to their file name suffixes (as they are if `\|\c
555 has not been used at all).
557 If you want only some of the four stages (preprocess, compile,
558 assemble, link), you can use
561 \&\|' (or filename suffixes) to tell \c
563 \& where to start, and
564 one of the options `\|\c
572 \& is to stop. Note that some combinations (for example,
574 .B \-x cpp\-output \-E\c
577 \& to do nothing at all.
580 Compile or assemble the source files, but do not link. The compiler
581 output is an object file corresponding to each source file.
583 By default, GCC makes the object file name for a source file by replacing
590 \&\|', etc., with `\|\c
594 \& to select another name.
596 GCC ignores any unrecognized input files (those that do not require
597 compilation or assembly) with the
602 Stop after the stage of compilation proper; do not assemble. The output
603 is an assembler code file for each non-assembler input
606 By default, GCC makes the assembler file name for a source file by
607 replacing the suffix `\|\c
611 \&\|', etc., with `\|\c
615 \& to select another name.
617 GCC ignores any input files that don't require compilation.
620 Stop after the preprocessing stage; do not run the compiler proper. The
621 output is preprocessed source code, which is sent to the
624 GCC ignores input files which don't require preprocessing.
627 Place output in file \c
629 \&. This applies regardless to whatever
630 sort of output GCC is producing, whether it be an executable file,
631 an object file, an assembler file or preprocessed C code.
633 Since only one output file can be specified, it does not make sense to
636 \&\|' when compiling more than one input file, unless you are
637 producing an executable file as output.
639 If you do not specify `\|\c
641 \&\|', the default is to put an executable file
644 \&\|', the object file for `\|\c
653 \&\|', its assembler file in `\|\c
657 all preprocessed C source on standard output.
660 Print (on standard error output) the commands executed to run the stages
661 of compilation. Also print the version number of the compiler driver
662 program and of the preprocessor and the compiler proper.
665 Use pipes rather than temporary files for communication between the
666 various stages of compilation. This fails to work on some systems where
667 the assembler cannot read from a pipe; but the GNU assembler has
671 The following options control the dialect of C that the compiler
675 Support all ANSI standard C programs.
677 This turns off certain features of GNU C that are incompatible with
678 ANSI C, such as the \c
684 keywords, and predefined macros such as \c
688 that identify the type of system you are using. It also enables the
689 undesirable and rarely used ANSI trigraph feature, and disallows `\|\c
691 \&\|' as part of identifiers.
693 The alternate keywords \c
696 .B _\|_extension_\|_\c
701 \& continue to work despite
704 \&\|'. You would not want to use them in an ANSI C program, of
705 course, but it is useful to put them in header files that might be included
706 in compilations done with `\|\c
708 \&\|'. Alternate predefined macros
713 \& are also available, with or
720 \&\|' option does not cause non-ANSI programs to be
721 rejected gratuitously. For that, `\|\c
728 The preprocessor predefines a macro \c
729 .B _\|_STRICT_ANSI_\|_\c
730 \& when you use the `\|\c
733 option. Some header files may notice this macro and refrain
734 from declaring certain functions or defining certain macros that the
735 ANSI standard doesn't call for; this is to avoid interfering with any
736 programs that might use these names for other things.
746 keyword. These words may then be used as identifiers. You can
761 Don't recognize built-in functions that do not begin with two leading
762 underscores. Currently, the functions affected include \c
796 \&\|' option prevents \c
801 being builtin functions.
804 Compile for a hosted environment; this implies the `\|\c
806 \&\|' option, and implies that suspicious declarations of
808 \& should be warned about.
811 Compile for a freestanding environment; this implies the `\|\c
813 \&\|' option, and implies that
815 \& has no special requirements.
817 .B \-fno\-strict\-prototype
818 Treat a function declaration with no arguments, such as `\|\c
821 \&\|', as C would treat it\(em\&as saying nothing about the number of
822 arguments or their types (C++ only). Normally, such a declaration in
823 C++ means that the function \c
825 \& takes no arguments.
828 Support ANSI C trigraphs. The `\|\c
830 \&\|' option implies `\|\c
835 Attempt to support some aspects of traditional C compilers.
836 For details, see the GNU C Manual; the duplicate list here
837 has been deleted so that we won't get complaints when it
840 .B \-traditional\-cpp
841 Attempt to support some aspects of traditional C preprocessors.
842 This includes the items that specifically mention the preprocessor above,
843 but none of the other effects of `\|\c
847 .B \-fdollars\-in\-identifiers
848 Permit the use of `\|\c
850 \&\|' in identifiers (C++ only). You can also use
852 .B \-fno\-dollars\-in\-identifiers\c
853 \&\|' to explicitly prohibit use of
856 \&\|'. (GNU C++ allows `\|\c
858 \&\|' by default on some target systems
861 .B \-fexternal\-templates
862 Produce smaller code for template declarations, by generating only a
863 single copy of each template function where it is defined (C++ only).
864 To use this option successfully, you must also mark all files that
865 use templates with either `\|\c
866 .B #pragma implementation\c
867 \&\|' (the definition) or
869 .B #pragma interface\c
870 \&\|' (declarations).
872 When your code is compiled with `\|\c
873 .B \-fexternal\-templates\c
875 template instantiations are external. You must arrange for all
876 necessary instantiations to appear in the implementation file; you can
879 \& that references each instantiation needed.
880 Conversely, when you compile using the default option
882 .B \-fno\-external\-templates\c
883 \&\|', all template instantiations are
887 Allow conditional expressions with mismatched types in the second and
888 third arguments. The value of such an expression is void.
893 \& be unsigned, like \c
897 Each kind of machine has a default for what \c
900 be. It is either like \c
902 \& by default or like
906 Ideally, a portable program should always use \c
910 \& when it depends on the signedness of an object.
911 But many programs have been written to use plain \c
914 expect it to be signed, or expect it to be unsigned, depending on the
915 machines they were written for. This option, and its inverse, let you
916 make such a program work with the opposite default.
920 \& is always a distinct type from each of
924 \&, even though its behavior
925 is always just like one of those two.
930 \& be signed, like \c
934 Note that this is equivalent to `\|\c
935 .B \-fno\-unsigned\-char\c
937 the negative form of `\|\c
938 .B \-funsigned\-char\c
941 .B \-fno\-signed\-char\c
942 \&\|' is equivalent to `\|\c
943 .B \-funsigned\-char\c
946 .B \-fsigned\-bitfields
948 .B \-funsigned\-bitfields
950 .B \-fno\-signed\-bitfields
952 .B \-fno\-unsigned\-bitfields
953 These options control whether a bitfield is
954 signed or unsigned, when declared with no explicit `\|\c
958 \&\|' qualifier. By default, such a bitfield is
959 signed, because this is consistent: the basic integer types such as
963 However, when you specify `\|\c
965 \&\|', bitfields are all unsigned
968 .B \-fwritable\-strings
969 Store string constants in the writable data segment and don't uniquize
970 them. This is for compatibility with old programs which assume they
971 can write into string constants. `\|\c
976 Writing into string constants is a very bad idea; \*(lqconstants\*(rq should
978 .SH PREPROCESSOR OPTIONS
979 These options control the C preprocessor, which is run on each C source
980 file before actual compilation.
984 \&\|' option, GCC does nothing except preprocessing.
985 Some of these options make sense only together with `\|\c
988 they cause the preprocessor output to be unsuitable for actual
991 .BI "\-include " "file"
994 \& as input before processing the regular input file.
995 In effect, the contents of \c
997 \& are compiled first. Any `\|\c
1002 \&\|' options on the command line are always processed before
1007 \&\|', regardless of the order in which they are
1008 written. All the `\|\c
1013 processed in the order in which they are written.
1015 .BI "\-imacros " file
1018 \& as input, discarding the resulting output, before
1019 processing the regular input file. Because the output generated from
1021 \& is discarded, the only effect of `\|\c
1026 make the macros defined in \c
1028 \& available for use in the main
1029 input. The preprocessor evaluates any `\|\c
1034 on the command line before processing `\|\c
1037 \&\|', regardless of the order in
1038 which they are written. All the `\|\c
1043 options are processed in the order in which they are written.
1045 .BI "\-idirafter " "dir"
1046 Add the directory \c
1048 \& to the second include path. The directories
1049 on the second include path are searched when a header file is not found
1050 in any of the directories in the main include path (the one that
1055 .BI "\-iprefix " "prefix"
1058 \& as the prefix for subsequent `\|\c
1063 .BI "\-iwithprefix " "dir"
1064 Add a directory to the second include path. The directory's name is
1065 made by concatenating \c
1071 was specified previously with `\|\c
1076 Do not search the standard system directories for header files. Only
1077 the directories you have specified with `\|\c
1079 \&\|' options (and the
1080 current directory, if appropriate) are searched.
1086 \&\|', you can limit the include-file search file to only those
1087 directories you specify explicitly.
1090 Do not search for header files in the C++\-specific standard directories,
1091 but do still search the other standard directories.
1092 (This option is used when building `\|\c
1097 Do not predefine any nonstandard macros. (Including architecture flags).
1100 Run only the C preprocessor. Preprocess all the C source files
1101 specified and output the results to standard output or to the
1102 specified output file.
1105 Tell the preprocessor not to discard comments. Used with the
1111 Tell the preprocessor not to generate `\|\c
1119 Tell the preprocessor to output a rule suitable for \c
1121 describing the dependencies of each object file. For each source file,
1122 the preprocessor outputs one \c
1124 \&-rule whose target is the object
1125 file name for that source file and whose dependencies are all the files
1128 \&\|'d in it. This rule may be a single line or may be
1129 continued with `\|\c
1131 \&\|'-newline if it is long. The list of rules is
1132 printed on standard output instead of the preprocessed C program.
1142 \&\|' says to treat missing header files as generated files and assume \c
1143 they live in the same directory as the source file. It must be specified \c
1144 in addition to `\|\c
1151 \&\|' but the output mentions only the user header files
1156 \&\|'. System header files
1166 \&\|' but the dependency information is written to files with
1167 names made by replacing `\|\c
1171 \&\|' at the end of the
1172 output file names. This is in addition to compiling the file as
1173 specified\(em\&`\|\c
1175 \&\|' does not inhibit ordinary compilation the way
1180 The Mach utility `\|\c
1182 \&\|' can be used to merge the `\|\c
1185 into a single dependency file suitable for using with the `\|\c
1193 \&\|' except mention only user header files, not system
1197 Print the name of each header file used, in addition to other normal
1200 .BI "\-A" "question" ( answer )
1205 \&, in case it is tested
1206 with a preprocessor conditional such as `\|\c
1207 .BI "#if #" question ( answer )\c
1210 \&\|' disables the standard
1211 assertions that normally describe the target machine.
1213 .BI "\-A" "question"\c
1217 Assert the answer \c
1221 \&, in case it is tested
1222 with a preprocessor conditional such as `\|\c
1231 \&\|' disables the standard
1232 assertions that normally describe the target machine.
1237 \& with the string `\|\c
1239 \&\|' as its definition.
1241 .BI \-D macro = defn
1246 \&. All instances of `\|\c
1249 the command line are processed before any `\|\c
1258 \&\|' options are evaluated after all `\|\c
1260 \&\|' options, but before any `\|\c
1267 Tell the preprocessor to output only a list of the macro definitions
1268 that are in effect at the end of preprocessing. Used with the `\|\c
1274 Tell the preprocessor to pass all macro definitions into the output, in
1275 their proper sequence in the rest of the output.
1280 \&\|' except that the macro arguments and contents are omitted.
1285 \&\|' is included in the output.
1286 .SH ASSEMBLER OPTION
1288 .BI "\-Wa," "option"
1291 \& as an option to the assembler. If \c
1293 contains commas, it is split into multiple options at the commas.
1295 These options come into play when the compiler links object files into
1296 an executable output file. They are meaningless if the compiler is
1297 not doing a link step.
1300 A file name that does not end in a special recognized suffix is
1301 considered to name an object file or library. (Object files are
1302 distinguished from libraries by the linker according to the file
1303 contents.) If GCC does a link step, these object files are used as input
1307 Use the library named \c
1311 The linker searches a standard list of directories for the library,
1312 which is actually a file named `\|\c
1317 then uses this file as if it had been specified precisely by name.
1319 The directories searched include several standard system directories
1320 plus any that you specify with `\|\c
1324 Normally the files found this way are library files\(em\&archive files
1325 whose members are object files. The linker handles an archive file by
1326 scanning through it for members which define symbols that have so far
1327 been referenced but not defined. However, if the linker finds an
1328 ordinary object file rather than a library, the object file is linked
1329 in the usual fashion. The only difference between using an `\|\c
1331 \&\|' option and specifying a file
1340 \&\|' and searches several directories.
1343 You need this special case of the
1345 option in order to link an Objective C program.
1348 Do not use the standard system startup files when linking.
1349 The standard libraries are used normally.
1352 Don't use the standard system libraries and startup files when linking.
1353 Only the files you specify will be passed to the linker.
1356 On systems that support dynamic linking, this prevents linking with the shared
1357 libraries. On other systems, this option has no effect.
1360 Produce a shared object which can then be linked with other objects to
1361 form an executable. Only a few systems support this option.
1364 Bind references to global symbols when building a shared object. Warn
1365 about any unresolved references (unless overridden by the link editor
1368 \-Xlinker \-z \-Xlinker defs\c
1369 \&\|'). Only a few systems support
1372 .BI "\-Xlinker " "option"
1375 as an option to the linker. You can use this to
1376 supply system-specific linker options which GNU CC does not know how to
1379 If you want to pass an option that takes an argument, you must use
1382 \&\|' twice, once for the option and once for the argument.
1383 For example, to pass `\|\c
1385 \-assert definitions\c
1386 \&\|', you must write
1389 \-Xlinker \-assert \-Xlinker definitions\c
1390 \&\|'. It does not work to write
1393 \-Xlinker "\-assert definitions"\c
1394 \&\|', because this passes the entire
1395 string as a single argument, which is not what the linker expects.
1397 .BI "\-Wl," "option"
1400 \& as an option to the linker. If \c
1403 commas, it is split into multiple options at the commas.
1408 is undefined, to force linking of
1409 library modules to define it. You can use `\|\c
1411 \&\|' multiple times with
1412 different symbols to force loading of additional library modules.
1413 .SH DIRECTORY OPTIONS
1414 These options specify directories to search for header files, for
1415 libraries and for parts of the compiler:
1420 \& to the list of directories searched for include files.
1423 Any directories you specify with `\|\c
1425 \&\|' options before the `\|\c
1428 option are searched only for the case of `\|\c
1435 they are not searched for `\|\c
1441 If additional directories are specified with `\|\c
1446 \&\|', these directories are searched for all `\|\c
1449 directives. (Ordinarily \c
1453 \&\|' directories are used
1456 In addition, the `\|\c
1458 \&\|' option inhibits the use of the current
1459 directory (where the current input file came from) as the first search
1466 \&\|'. There is no way to
1467 override this effect of `\|\c
1471 \&\|' you can specify
1472 searching the directory which was current when the compiler was
1473 invoked. That is not exactly the same as what the preprocessor does
1474 by default, but it is often satisfactory.
1478 \&\|' does not inhibit the use of the standard system directories
1479 for header files. Thus, `\|\c
1489 \& to the list of directories to be searched
1495 This option specifies where to find the executables, libraries and
1496 data files of the compiler itself.
1498 The compiler driver program runs one or more of the subprograms
1503 \&\|' (or, for C++, `\|\c
1511 \& as a prefix for each program it tries to run, both with and
1519 For each subprogram to be run, the compiler driver first tries the
1522 \&\|' prefix, if any. If that name is not found, or if `\|\c
1525 was not specified, the driver tries two standard prefixes, which are
1529 .B /usr/local/lib/gcc-lib/\c
1530 \&\|'. If neither of
1531 those results in a file name that is found, the compiler driver
1532 searches for the unmodified program
1533 name, using the directories specified in your
1536 \&\|' environment variable.
1538 The run-time support file `\|\c
1540 \&\|' is also searched for using the
1543 \&\|' prefix, if needed. If it is not found there, the two
1544 standard prefixes above are tried, and that is all. The file is left
1545 out of the link if it is not found by those means. Most of the time,
1546 on most machines, `\|\c
1548 \&\|' is not actually necessary.
1550 You can get a similar result from the environment variable
1551 .B GCC_EXEC_PREFIX\c
1552 \&; if it is defined, its value is used as a prefix
1553 in the same way. If both the `\|\c
1555 \&\|' option and the
1556 .B GCC_EXEC_PREFIX\c
1557 \& variable are present, the `\|\c
1560 used first and the environment variable value second.
1562 Warnings are diagnostic messages that report constructions which
1563 are not inherently erroneous but which are risky or suggest there
1564 may have been an error.
1566 These options control the amount and kinds of warnings produced by GNU
1570 Check the code for syntax errors, but don't emit any output.
1573 Inhibit all warning messages.
1576 Inhibit warning messages about the use of
1580 Issue all the warnings demanded by strict ANSI standard C; reject
1581 all programs that use forbidden extensions.
1583 Valid ANSI standard C programs should compile properly with or without
1584 this option (though a rare few will require `\|\c
1587 without this option, certain GNU extensions and traditional C features
1588 are supported as well. With this option, they are rejected. There is
1591 \& this option; it exists only to satisfy pedants.
1595 \&\|' does not cause warning messages for use of the
1596 alternate keywords whose names begin and end with `\|\c
1599 warnings are also disabled in the expression that follows
1600 .B _\|_extension_\|_\c
1601 \&. However, only system header files should use
1602 these escape routes; application programs should avoid them.
1604 .B \-pedantic\-errors
1607 \&\|', except that errors are produced rather than
1611 Print extra warning messages for these events:
1614 A nonvolatile automatic variable might be changed by a call to
1616 \&. These warnings are possible only in
1617 optimizing compilation.
1619 The compiler sees only the calls to \c
1624 \& will be called; in fact, a signal handler could
1625 call it at any point in the code. As a result, you may get a warning
1626 even when there is in fact no problem because \c
1629 in fact be called at the place which would cause a problem.
1632 A function can return either with or without a value. (Falling
1633 off the end of the function body is considered returning without
1634 a value.) For example, this function would evoke such a
1645 Spurious warnings can occur because GNU CC does not realize that
1646 certain functions (including \c
1654 An expression-statement or the left-hand side of a comma expression
1655 contains no side effects.
1656 To suppress the warning, cast the unused expression to void.
1657 For example, an expression such as `\|\c
1659 \&\|' will cause a warning,
1665 An unsigned value is compared against zero with `\|\c
1673 Warn whenever a declaration does not specify a type.
1675 .B \-Wimplicit-function-declaration
1676 Warn whenever a function is used before being declared.
1679 Same as -Wimplicit-int and -Wimplicit-function-declaration.
1684 function is declared or defined with a suspicious type.
1685 Typically, it is a function with external linkage, returning
1688 taking zero or two arguments.
1692 Warn whenever a function is defined with a return-type that defaults
1695 \&. Also warn about any \c
1697 \& statement with no
1698 return-value in a function whose return-type is not \c
1702 .B \-Wunused\-function
1703 Warn whenever a static function is declared but not defined or a
1704 non\-inline static function is unused.
1707 Warn whenever a label is declared but not used.
1709 To suppress this warning use the
1713 .B \-Wunused\-parameter
1714 Warn whenever a function parameter is unused aside from its declaration.
1716 To suppress this warning use the
1720 .B \-Wunused\-variable
1721 Warn whenever a local variable or non\-constant static variable
1722 is unused aside from its declaration
1724 To suppress this warning use the
1729 Warn whenever a statement computes a result that is explicitly not used.
1731 To suppress this warning cast the expression to
1736 All all the above `\|\c
1738 \&\|' options combined.
1740 In order to get a warning about an unused function parameter, you must
1741 either specify `\|\c
1743 \&\|' or separatly specify `\|\c
1744 .B \-Wunused\-parameter\c
1750 \& statement has an index of enumeral type
1753 \& for one or more of the named codes of that
1754 enumeration. (The presence of a \c
1756 \& label prevents this
1759 \& labels outside the enumeration range also
1760 provoke warnings when this option is used.
1763 Warn whenever a comment-start sequence `\|\c
1765 \&\|' appears in a comment.
1768 Warn if any trigraphs are encountered (assuming they are enabled).
1775 \&, etc., to make sure that
1776 the arguments supplied have types appropriate to the format string
1779 .B \-Wchar\-subscripts
1780 Warn if an array subscript has type
1782 This is a common cause of error, as programmers often forget that this
1783 type is signed on some machines.
1786 An automatic variable is used without first being initialized.
1788 These warnings are possible only in optimizing compilation,
1789 because they require data flow information that is computed only
1790 when optimizing. If you don't specify `\|\c
1792 \&\|', you simply won't
1795 These warnings occur only for variables that are candidates for
1796 register allocation. Therefore, they do not occur for a variable that
1799 \&, or whose address is taken, or whose size
1800 is other than 1, 2, 4 or 8 bytes. Also, they do not occur for
1801 structures, unions or arrays, even when they are in registers.
1803 Note that there may be no warning about a variable that is used only
1804 to compute a value that itself is never used, because such
1805 computations may be deleted by data flow analysis before the warnings
1808 These warnings are made optional because GNU CC is not smart
1809 enough to see all the reasons why the code might be correct
1810 despite appearing to have an error. Here is one example of how
1830 \& is always 1, 2 or 3, then \c
1833 always initialized, but GNU CC doesn't know this. Here is
1834 another common case:
1839 if (change_y) save_y = y, y = new_y;
1841 if (change_y) y = save_y;
1845 This has no bug because \c
1847 \& is used only if it is set.
1849 Some spurious warnings can be avoided if you declare as
1851 \& all the functions you use that never return.
1854 Warn if parentheses are omitted in certain contexts.
1857 All of the above `\|\c
1859 \&\|' options combined. These are all the
1860 options which pertain to usage that we recommend avoiding and that we
1861 believe is easy to avoid, even in conjunction with macros.
1865 \&\|' options are not implied by `\|\c
1868 because they warn about constructions that we consider reasonable to
1869 use, on occasion, in clean programs.
1872 Warn about certain constructs that behave differently in traditional and
1876 Macro arguments occurring within string constants in the macro body.
1877 These would substitute the argument in traditional C, but are part of
1878 the constant in ANSI C.
1881 A function declared external in one block and then used after the end of
1887 \& statement has an operand of type \c
1893 Warn whenever a local variable shadows another local variable.
1895 .BI "\-Wid\-clash\-" "len"
1896 Warn whenever two distinct identifiers match in the first \c
1898 characters. This may help you prepare a program that will compile
1899 with certain obsolete, brain-damaged compilers.
1901 .B \-Wpointer\-arith
1902 Warn about anything that depends on the \*(lqsize of\*(rq a function type or
1905 \&. GNU C assigns these types a size of 1, for
1906 convenience in calculations with \c
1908 \& pointers and pointers
1912 Warn whenever a pointer is cast so as to remove a type qualifier from
1913 the target type. For example, warn if a \c
1914 .B const char \(**\c
1921 Warn whenever a pointer is cast such that the required alignment of the
1922 target is increased. For example, warn if a \c
1927 \& on machines where integers can only be accessed at
1928 two- or four-byte boundaries.
1930 .B \-Wwrite\-strings
1931 Give string constants the type \c
1936 copying the address of one into a non-\c
1940 pointer will get a warning. These warnings will help you find at
1941 compile time code that can try to write into a string constant, but
1942 only if you have been very careful about using \c
1945 declarations and prototypes. Otherwise, it will just be a nuisance;
1946 this is why we did not make `\|\c
1948 \&\|' request these warnings.
1951 Warn if a prototype causes a type conversion that is different from what
1952 would happen to the same argument in the absence of a prototype. This
1953 includes conversions of fixed point to floating and vice versa, and
1954 conversions changing the width or signedness of a fixed point argument
1955 except when the same as the default promotion.
1957 .B \-Waggregate\-return
1958 Warn if any functions that return structures or unions are defined or
1959 called. (In languages where you can return an array, this also elicits
1962 .B \-Wstrict\-prototypes
1963 Warn if a function is declared or defined without specifying the
1964 argument types. (An old-style function definition is permitted without
1965 a warning if preceded by a declaration which specifies the argument
1968 .B \-Wmissing\-prototypes
1969 Warn if a global function is defined without a previous prototype
1970 declaration. This warning is issued even if the definition itself
1971 provides a prototype. The aim is to detect global functions that fail
1972 to be declared in header files.
1974 .B \-Wmissing\-declarations
1975 Warn if a global function is defined without a previous declaration.
1976 Do so even if the definition itself provides a prototype.
1977 Use this option to detect global functions that are not declared in
1980 .B \-Wredundant-decls
1981 Warn if anything is declared more than once in the same scope, even in
1982 cases where multiple declaration is valid and changes nothing.
1987 type is used. This is default. To inhibit
1988 the warning messages, use flag `\|\c
1989 .B \-Wno\-long\-long\c
1991 .B \-W\-long\-long\c
1993 .B \-Wno\-long\-long\c
1994 \&\|' are taken into account only when flag `\|\c
1998 .B \-Woverloaded\-virtual
2000 In a derived class, the definitions of virtual functions must match
2001 the type signature of a virtual function declared in the base class.
2002 Use this option to request warnings when a derived class declares a
2003 function that may be an erroneous attempt to define a virtual
2004 function: that is, warn when a function with the same name as a
2005 virtual function in the base class, but with a type signature that
2006 doesn't match any virtual functions from the base class.
2009 Warn if a function can not be inlined, and either it was declared as inline,
2011 .B \-finline\-functions
2015 Treat warnings as errors; abort compilation after any warning.
2016 .SH DEBUGGING OPTIONS
2017 GNU CC has various special options that are used for debugging
2018 either your program or GCC:
2021 Produce debugging information in the operating system's native format
2022 (stabs, COFF, XCOFF, or DWARF). GDB can work with this debugging
2025 On most systems that use stabs format, `\|\c
2027 \&\|' enables use of extra
2028 debugging information that only GDB can use; this extra information
2029 makes debugging work better in GDB but will probably make other debuggers
2031 refuse to read the program. If you want to control for certain whether
2032 to generate the extra information, use `\|\c
2048 Unlike most other C compilers, GNU CC allows you to use `\|\c
2053 \&\|'. The shortcuts taken by optimized code may occasionally
2054 produce surprising results: some variables you declared may not exist
2055 at all; flow of control may briefly move where you did not expect it;
2056 some statements may not be executed because they compute constant
2057 results or their values were already at hand; some statements may
2058 execute in different places because they were moved out of loops.
2060 Nevertheless it proves possible to debug optimized output. This makes
2061 it reasonable to use the optimizer for programs that might have bugs.
2063 The following options are useful when GNU CC is generated with the
2064 capability for more than one debugging format.
2067 Produce debugging information in the native format (if that is supported),
2068 including GDB extensions if at all possible.
2071 Produce debugging information in stabs format (if that is supported),
2072 without GDB extensions. This is the format used by DBX on most BSD
2076 Produce debugging information in stabs format (if that is supported),
2077 using GNU extensions understood only by the GNU debugger (GDB). The
2078 use of these extensions is likely to make other debuggers crash or
2079 refuse to read the program.
2082 Produce debugging information in COFF format (if that is supported).
2083 This is the format used by SDB on most System V systems prior to
2087 Produce debugging information in XCOFF format (if that is supported).
2088 This is the format used by the DBX debugger on IBM RS/6000 systems.
2091 Produce debugging information in XCOFF format (if that is supported),
2092 using GNU extensions understood only by the GNU debugger (GDB). The
2093 use of these extensions is likely to make other debuggers crash or
2094 refuse to read the program.
2097 Produce debugging information in DWARF format (if that is supported).
2098 This is the format used by SDB on most System V Release 4 systems.
2101 Produce debugging information in DWARF format (if that is supported),
2102 using GNU extensions understood only by the GNU debugger (GDB). The
2103 use of these extensions is likely to make other debuggers crash or
2104 refuse to read the program.
2108 .BI "\-ggdb" "level"
2110 .BI "\-gstabs" "level"
2112 .BI "\-gcoff" "level"
2113 .BI "\-gxcoff" "level"
2115 .BI "\-gdwarf" "level"
2116 Request debugging information and also use \c
2119 much information. The default level is 2.
2121 Level 1 produces minimal information, enough for making backtraces in
2122 parts of the program that you don't plan to debug. This includes
2123 descriptions of functions and external variables, but no information
2124 about local variables and no line numbers.
2126 Level 3 includes extra information, such as all the macro definitions
2127 present in the program. Some debuggers support macro expansion when
2133 Generate extra code to write profile information suitable for the
2139 Generate extra code to write profile information suitable for the
2145 Generate extra code to write profile information for basic blocks,
2146 which will record the number of times each basic block is executed.
2147 This data could be analyzed by a program like \c
2150 however, that the format of the data is not what \c
2155 \& should be extended to process this data.
2158 Generate extra code to read basic block profiling parameters from
2159 file `bb.in' and write profiling results to file `bb.out'.
2160 `bb.in' contains a list of functions. Whenever a function on the list
2161 is entered, profiling is turned on. When the outmost function is left,
2162 profiling is turned off. If a function name is prefixed with `-'
2163 the function is excluded from profiling. If a function name is not
2164 unique it can be disambiguated by writing
2165 `/path/filename.d:functionname'. `bb.out' will list some available
2167 Four function names have a special meaning:
2168 `__bb_jumps__' will cause jump frequencies to be written to `bb.out'.
2169 `__bb_trace__' will cause the sequence of basic blocks to be piped
2170 into `gzip' and written to file `bbtrace.gz'.
2171 `__bb_hidecall__' will cause call instructions to be excluded from
2173 `__bb_showret__' will cause return instructions to be included in
2177 Says to make debugging dumps during compilation at times specified by
2179 \&. This is used for debugging the compiler. The file names
2180 for most of the dumps are made by appending a word to the source file
2188 Dump all macro definitions, at the end of preprocessing, and write no
2192 Dump all macro names, at the end of preprocessing.
2195 Dump all macro definitions, at the end of preprocessing, in addition to
2199 Dump debugging information during parsing, to standard error.
2202 Dump after RTL generation, to `\|\c
2208 Just generate RTL for a function instead of compiling it. Usually used
2214 Dump after first jump optimization, to `\|\c
2220 Dump after CSE (including the jump optimization that sometimes
2221 follows CSE), to `\|\c
2227 Dump after loop optimization, to `\|\c
2233 Dump after the second CSE pass (including the jump optimization that
2234 sometimes follows CSE), to `\|\c
2240 Dump after flow analysis, to `\|\c
2246 Dump after instruction combination, to `\|\c
2252 Dump after the first instruction scheduling pass, to
2259 Dump after local register allocation, to `\|\c
2265 Dump after global register allocation, to `\|\c
2271 Dump after the second instruction scheduling pass, to
2278 Dump after last jump optimization, to `\|\c
2284 Dump after delayed branch scheduling, to `\|\c
2290 Dump after conversion from registers to stack, to `\|\c
2296 Produce all the dumps listed above.
2299 Print statistics on memory usage, at the end of the run, to
2303 Annotate the assembler output with a comment indicating which
2304 pattern and alternative was used.
2306 .B \-fpretend\-float
2307 When running a cross-compiler, pretend that the target machine uses the
2308 same floating point format as the host machine. This causes incorrect
2309 output of the actual floating constants, but the actual instruction
2310 sequence will probably be the same as GNU CC would make when running on
2314 Store the usual \*(lqtemporary\*(rq intermediate files permanently; place them
2315 in the current directory and name them based on the source file. Thus,
2319 .B \-c \-save\-temps\c
2320 \&\|' would produce files
2325 \&\|', as well as `\|\c
2329 .BI "\-print\-file\-name=" "library"
2330 Print the full absolute name of the library file \|\c
2335 would be used when linking\(em\&and do not do anything else. With this
2336 option, GNU CC does not compile or link anything; it just prints the
2339 .B \-print\-libgcc\-file\-name
2341 .B \-print\-file\-name=libgcc.a\c
2344 .BI "\-print\-prog\-name=" "program"
2346 .B \-print\-file\-name\c
2347 \&\|', but searches for a program such as `\|\c
2350 .SH OPTIMIZATION OPTIONS
2351 These options control various sorts of optimizations:
2356 Optimize. Optimizing compilation takes somewhat more time, and a lot
2357 more memory for a large function.
2361 \&\|', the compiler's goal is to reduce the cost of
2362 compilation and to make debugging produce the expected results.
2363 Statements are independent: if you stop the program with a breakpoint
2364 between statements, you can then assign a new value to any variable or
2365 change the program counter to any other statement in the function and
2366 get exactly the results you would expect from the source code.
2370 \&\|', only variables declared \c
2373 allocated in registers. The resulting compiled code is a little worse
2374 than produced by PCC without `\|\c
2380 \&\|', the compiler tries to reduce code size and execution
2383 When you specify `\|\c
2385 \&\|', the two options `\|\c
2386 .B \-fthread\-jumps\c
2389 \&\|' are turned on. On machines that have delay slots, the `\|\c
2390 .B \-fdelayed\-branch\c
2391 \&\|' option is turned on. For those machines that can support debugging even
2392 without a frame pointer, the `\|\c
2393 .B \-fomit\-frame\-pointer\c
2394 \&\|' option is turned on. On some machines other flags may also be turned on.
2397 Optimize even more. Nearly all supported optimizations that do not
2398 involve a space-speed tradeoff are performed. Loop unrolling and function
2399 inlining are not done, for example. As compared to
2402 this option increases both compilation time and the performance of the
2406 Optimize yet more. This turns on everything
2408 does, along with also turning on
2409 .B \-finline\-functions.
2416 options, with or without level numbers, the last such option is the
2417 one that is effective.
2419 Options of the form `\|\c
2423 \&\|' specify machine-independent
2424 flags. Most flags have both positive and negative forms; the negative
2427 \&\|' would be `\|\c
2429 \&\|'. The following list shows
2430 only one form\(em\&the one which is not the default.
2431 You can figure out the other form by either removing `\|\c
2437 Do not store floating point variables in registers. This
2438 prevents undesirable excess precision on machines such as the
2439 68000 where the floating registers (of the 68881) keep more
2442 \& is supposed to have.
2444 For most programs, the excess precision does only good, but a few
2445 programs rely on the precise definition of IEEE floating point.
2447 .B \-ffloat\-store\c
2448 \&\|' for such programs.
2450 .B \-fmemoize\-lookups
2452 .B \-fsave\-memoized
2453 Use heuristics to compile faster (C++ only). These heuristics are not
2454 enabled by default, since they are only effective for certain input
2455 files. Other input files compile more slowly.
2457 The first time the compiler must build a call to a member function (or
2458 reference to a data member), it must (1) determine whether the class
2459 implements member functions of that name; (2) resolve which member
2460 function to call (which involves figuring out what sorts of type
2461 conversions need to be made); and (3) check the visibility of the member
2462 function to the caller. All of this adds up to slower compilation.
2463 Normally, the second time a call is made to that member function (or
2464 reference to that data member), it must go through the same lengthy
2465 process again. This means that code like this
2467 \& cout << "This " << p << " has " << n << " legs.\en";
2469 makes six passes through all three steps. By using a software cache,
2470 a \*(lqhit\*(rq significantly reduces this cost. Unfortunately, using the
2471 cache introduces another layer of mechanisms which must be implemented,
2472 and so incurs its own overhead. `\|\c
2473 .B \-fmemoize\-lookups\c
2477 Because access privileges (visibility) to members and member functions
2478 may differ from one function context to the next,
2480 may need to flush the cache. With the `\|\c
2481 .B \-fmemoize\-lookups\c
2482 \&\|' flag, the cache is flushed after every
2483 function that is compiled. The `\|\c
2485 \&\|' flag enables the same software cache, but when the compiler
2486 determines that the context of the last function compiled would yield
2487 the same access privileges of the next function to compile, it
2488 preserves the cache.
2489 This is most helpful when defining many member functions for the same
2490 class: with the exception of member functions which are friends of
2491 other classes, each member function has exactly the same access
2492 privileges as every other, and the cache need not be flushed.
2494 .B \-fno\-default\-inline
2495 Don't make member functions inline by default merely because they are
2496 defined inside the class scope (C++ only).
2498 .B \-fno\-defer\-pop
2499 Always pop the arguments to each function call as soon as that
2500 function returns. For machines which must pop arguments after a
2501 function call, the compiler normally lets arguments accumulate on the
2502 stack for several function calls and pops them all at once.
2505 Force memory operands to be copied into registers before doing
2506 arithmetic on them. This may produce better code by making all
2507 memory references potential common subexpressions. When they are
2508 not common subexpressions, instruction combination should
2509 eliminate the separate register-load. I am interested in hearing
2510 about the difference this makes.
2513 Force memory address constants to be copied into registers before
2514 doing arithmetic on them. This may produce better code just as
2517 \&\|' may. I am interested in hearing about the
2518 difference this makes.
2520 .B \-fomit\-frame\-pointer
2521 Don't keep the frame pointer in a register for functions that
2522 don't need one. This avoids the instructions to save, set up and
2523 restore frame pointers; it also makes an extra register available
2524 in many functions. \c
2525 .I It also makes debugging impossible on most machines\c
2528 On some machines, such as the Vax, this flag has no effect, because
2529 the standard calling sequence automatically handles the frame pointer
2530 and nothing is saved by pretending it doesn't exist. The
2531 machine-description macro \c
2532 .B FRAME_POINTER_REQUIRED\c
2534 whether a target machine supports this flag.
2536 .B \-finline\-functions
2537 Integrate all simple functions into their callers. The compiler
2538 heuristically decides which functions are simple enough to be worth
2539 integrating in this way.
2541 If all calls to a given function are integrated, and the function is
2544 \&, then GCC normally does not output the function as
2545 assembler code in its own right.
2548 Enable values to be allocated in registers that will be clobbered by
2549 function calls, by emitting extra instructions to save and restore the
2550 registers around such calls. Such allocation is done only when it
2551 seems to result in better code than would otherwise be produced.
2553 This option is enabled by default on certain machines, usually those
2554 which have no call-preserved registers to use instead.
2556 .B \-fkeep\-inline\-functions
2557 Even if all calls to a given function are integrated, and the function
2560 \&, nevertheless output a separate run-time
2561 callable version of the function.
2563 .B \-fno\-function\-cse
2564 Do not put function addresses in registers; make each instruction that
2565 calls a constant function contain the function's address explicitly.
2567 This option results in less efficient code, but some strange hacks
2568 that alter the assembler output may be confused by the optimizations
2569 performed when this option is not used.
2572 Disable any machine-specific peephole optimizations.
2575 This option allows GCC to violate some ANSI or IEEE rules/specifications
2576 in the interest of optimizing code for speed. For example, it allows
2577 the compiler to assume arguments to the \c
2580 non-negative numbers.
2582 This option should never be turned on by any `\|\c
2585 it can result in incorrect output for programs which depend on
2586 an exact implementation of IEEE or ANSI rules/specifications for
2589 The following options control specific optimizations. The `\|\c
2592 option turns on all of these optimizations except `\|\c
2593 .B \-funroll\-loops\c
2596 .B \-funroll\-all\-loops\c
2601 \&\|' option usually turns on
2603 .B \-fthread\-jumps\c
2605 .B \-fdelayed\-branch\c
2607 specific machines may change the default optimizations.
2609 You can use the following flags in the rare cases when \*(lqfine-tuning\*(rq
2610 of optimizations to be performed is desired.
2612 .B \-fstrength\-reduce
2613 Perform the optimizations of loop strength reduction and
2614 elimination of iteration variables.
2617 Perform optimizations where we check to see if a jump branches to a
2618 location where another comparison subsumed by the first is found. If
2619 so, the first branch is redirected to either the destination of the
2620 second branch or a point immediately following it, depending on whether
2621 the condition is known to be true or false.
2624 Perform the optimization of loop unrolling. This is only done for loops
2625 whose number of iterations can be determined at compile time or run time.
2627 .B \-funroll\-all\-loops
2628 Perform the optimization of loop unrolling. This is done for all loops.
2629 This usually makes programs run more slowly.
2631 .B \-fcse\-follow\-jumps
2632 In common subexpression elimination, scan through jump instructions
2633 when the target of the jump is not reached by any other path. For
2634 example, when CSE encounters an \c
2636 \& statement with an
2638 \& clause, CSE will follow the jump when the condition
2641 .B \-fcse\-skip\-blocks
2642 This is similar to `\|\c
2643 .B \-fcse\-follow\-jumps\c
2644 \&\|', but causes CSE to
2645 follow jumps which conditionally skip over blocks. When CSE
2646 encounters a simple \c
2648 \& statement with no else clause,
2650 .B \-fcse\-skip\-blocks\c
2651 \&\|' causes CSE to follow the jump around the
2656 .B \-frerun\-cse\-after\-loop
2657 Re-run common subexpression elimination after loop optimizations has been
2660 .B \-felide\-constructors
2661 Elide constructors when this seems plausible (C++ only). With this
2662 flag, GNU C++ initializes \c
2664 \& directly from the call to \c
2666 without going through a temporary in the following code:
2671 Without this option, GNU C++ first initializes \c
2674 appropriate constructor for type \c
2676 \&; then assigns the result of
2678 \& to a temporary; and, finally, replaces the initial value of
2681 \&\|' with the temporary.
2683 The default behavior (`\|\c
2684 .B \-fno\-elide\-constructors\c
2685 \&\|') is specified by
2686 the draft ANSI C++ standard. If your program's constructors have side
2687 effects, using `\|\c
2688 .B \-felide-constructors\c
2689 \&\|' can make your program act
2690 differently, since some constructor calls may be omitted.
2692 .B \-fexpensive\-optimizations
2693 Perform a number of minor optimizations that are relatively expensive.
2695 .B \-fdelayed\-branch
2696 If supported for the target machine, attempt to reorder instructions
2697 to exploit instruction slots available after delayed branch
2700 .B \-fschedule\-insns
2701 If supported for the target machine, attempt to reorder instructions to
2702 eliminate execution stalls due to required data being unavailable. This
2703 helps machines that have slow floating point or memory load instructions
2704 by allowing other instructions to be issued until the result of the load
2705 or floating point instruction is required.
2707 .B \-fschedule\-insns2
2709 .B \-fschedule\-insns\c
2710 \&\|', but requests an additional pass of
2711 instruction scheduling after register allocation has been done. This is
2712 especially useful on machines with a relatively small number of
2713 registers and where memory load instructions take more than one cycle.
2715 By default, GNU CC compiles code for the same type of machine that you
2716 are using. However, it can also be installed as a cross-compiler, to
2717 compile for some other type of machine. In fact, several different
2718 configurations of GNU CC, for different target machines, can be
2719 installed side by side. Then you specify which one to use with the
2724 In addition, older and newer versions of GNU CC can be installed side
2725 by side. One of them (probably the newest) will be the default, but
2726 you may sometimes wish to use another.
2728 .BI "\-b " "machine"
2731 \& specifies the target machine for compilation.
2732 This is useful when you have installed GNU CC as a cross-compiler.
2734 The value to use for \c
2736 \& is the same as was specified as the
2737 machine type when configuring GNU CC as a cross-compiler. For
2738 example, if a cross-compiler was configured with `\|\c
2741 \&\|', meaning to compile for an 80386 running System V, then you
2744 \&\|' to run that cross compiler.
2746 When you do not specify `\|\c
2748 \&\|', it normally means to compile for
2749 the same type of machine that you are using.
2751 .BI "\-V " "version"
2754 \& specifies which version of GNU CC to run.
2755 This is useful when multiple versions are installed. For example,
2759 \&\|', meaning to run GNU CC version 2.0.
2761 The default version, when you do not specify `\|\c
2763 \&\|', is controlled
2764 by the way GNU CC is installed. Normally, it will be a version that
2765 is recommended for general use.
2766 .SH MACHINE DEPENDENT OPTIONS
2767 Each of the target machine types can have its own special options,
2770 \&\|', to choose among various hardware models or
2771 configurations\(em\&for example, 68010 vs 68020, floating coprocessor or
2772 none. A single installed version of the compiler can compile for any
2773 model or configuration, according to the options specified.
2775 Some configurations of the compiler also support additional special
2776 options, usually for command-line compatibility with other compilers on
2781 \&\|' options defined for the 68000 series:
2786 Generate output for a 68000. This is the default when the compiler is
2787 configured for 68000-based systems.
2792 Generate output for a 68020 (rather than a 68000). This is the
2793 default when the compiler is configured for 68020-based systems.
2796 Generate output containing 68881 instructions for floating point.
2797 This is the default for most 68020-based systems unless
2799 was specified when the compiler was configured.
2802 Generate output for a 68030. This is the default when the compiler is
2803 configured for 68030-based systems.
2806 Generate output for a 68040. This is the default when the compiler is
2807 configured for 68040-based systems.
2810 Generate output for a 68040, without using any of the new instructions.
2811 This results in code which can run relatively efficiently on either a
2812 68020/68881 or a 68030 or a 68040.
2815 Generate output containing Sun FPA instructions for floating point.
2818 Generate output containing library calls for floating point.
2821 the requisite libraries are not part of GNU CC. Normally the
2822 facilities of the machine's usual C compiler are used, but this can't
2823 be done directly in cross-compilation. You must make your own
2824 arrangements to provide suitable library functions for cross-compilation.
2829 \& to be 16 bits wide, like \c
2834 Do not use the bit-field instructions. `\|\c
2842 Do use the bit-field instructions. `\|\c
2847 \&\|'. This is the default if you use the unmodified
2851 Use a different function-calling convention, in which functions
2852 that take a fixed number of arguments return with the \c
2854 instruction, which pops their arguments while returning. This
2855 saves one instruction in the caller since there is no need to pop
2856 the arguments there.
2858 This calling convention is incompatible with the one normally
2859 used on Unix, so you cannot use it if you need to call libraries
2860 compiled with the Unix compiler.
2862 Also, you must provide function prototypes for all functions that
2863 take variable numbers of arguments (including \c
2866 otherwise incorrect code will be generated for calls to those
2869 In addition, seriously incorrect code will result if you call a
2870 function with too many arguments. (Normally, extra arguments are
2871 harmlessly ignored.)
2875 \& instruction is supported by the 68010 and 68020
2876 processors, but not by the 68000.
2880 \&\|' options are defined for the Vax:
2883 Do not output certain jump instructions (\c
2886 that the Unix assembler for the Vax cannot handle across long
2890 Do output those jump instructions, on the assumption that you
2891 will assemble with the GNU assembler.
2894 Output code for g-format floating point numbers instead of d-format.
2898 \&\|' switches are supported on the SPARC:
2903 Generate output containing floating point instructions. This is the
2909 Generate output containing library calls for floating point.
2911 there is no GNU floating-point library for SPARC.
2912 Normally the facilities of the machine's usual C compiler are used, but
2913 this cannot be done directly in cross-compilation. You must make your
2914 own arrangements to provide suitable library functions for
2918 changes the calling convention in the output file;
2919 therefore, it is only useful if you compile
2921 of a program with this option.
2928 (the default), the compiler always emits code for
2929 function exit at the end of each function. Any function exit in
2930 the middle of the function (such as a return statement in C) will
2931 generate a jump to the exit code at the end of the function.
2934 .BR \-mno\-epilogue ,
2935 the compiler tries to emit exit code inline at every function exit.
2942 These three options select variations on the SPARC architecture.
2944 By default (unless specifically configured for the Fujitsu SPARClite),
2945 GCC generates code for the v7 variant of the SPARC architecture.
2948 will give you SPARC v8 code. The only difference from v7
2949 code is that the compiler emits the integer multiply and integer
2950 divide instructions which exist in SPARC v8 but not in SPARC v7.
2953 will give you SPARClite code. This adds the integer
2954 multiply, integer divide step and scan (ffs) instructions which
2955 exist in SPARClite but not in SPARC v7.
2960 These two options select the processor for which the code is optimised.
2964 (the default), the compiler optimises code for the Cypress CY7C602 chip, as
2965 used in the SparcStation/SparcServer 3xx series. This is also appropriate for
2966 the older SparcStation 1, 2, IPX etc.
2970 the compiler optimises code for the SuperSparc cpu, as used in the SparcStation
2971 10, 1000 and 2000 series. This flag also enables use of the full SPARC v8
2976 \&\|' options are defined for the Convex:
2979 Generate output for a C1. This is the default when the compiler is
2980 configured for a C1.
2983 Generate output for a C2. This is the default when the compiler is
2984 configured for a C2.
2987 Generate code which puts an argument count in the word preceding each
2988 argument list. Some nonportable Convex and Vax programs need this word.
2989 (Debuggers don't, except for functions with variable-length argument
2990 lists; this info is in the symbol table.)
2993 Omit the argument count word. This is the default if you use the
2998 \&\|' options are defined for the AMD Am29000:
3001 Generate code that assumes the DW bit is set, i.e., that byte and
3002 halfword operations are directly supported by the hardware. This is the
3006 Generate code that assumes the DW bit is not set.
3009 Generate code that assumes the system supports byte and halfword write
3010 operations. This is the default.
3013 Generate code that assumes the systems does not support byte and
3014 halfword write operations. This implies `\|\c
3019 Use a small memory model that assumes that all function addresses are
3020 either within a single 256 KB segment or at an absolute address of less
3021 than 256K. This allows the \c
3023 \& instruction to be used instead
3033 Do not assume that the \c
3035 \& instruction can be used; this is the
3039 Generate code for the Am29050.
3042 Generate code for the Am29000. This is the default.
3044 .B \-mkernel\-registers
3045 Generate references to registers \c
3049 \&. This option can be used when compiling kernel code
3050 that wants a set of global registers disjoint from that used by
3053 Note that when this option is used, register names in `\|\c
3056 must use the normal, user-mode, names.
3058 .B \-muser\-registers
3059 Use the normal set of global registers, \c
3067 \& after each stack adjustment. This
3068 is often used for kernel code.
3072 \&\|' options are defined for Motorola 88K architectures:
3075 Generate code that works well on both the m88100 and the
3079 Generate code that works best for the m88100, but that also
3083 Generate code that works best for the m88110, and may not run
3086 .B \-midentify\-revision
3089 \& directive in the assembler output recording the
3090 source file name, compiler name and version, timestamp, and compilation
3093 .B \-mno\-underscores
3094 In assembler output, emit symbol names without adding an underscore
3095 character at the beginning of each name. The default is to use an
3096 underscore as prefix on each name.
3098 .B \-mno\-check\-zero\-division
3100 .B \-mcheck\-zero\-division
3101 Early models of the 88K architecture had problems with division by zero;
3102 in particular, many of them didn't trap. Use these options to avoid
3103 including (or to include explicitly) additional code to detect division
3104 by zero and signal an exception. All GCC configurations for the 88K use
3106 .B \-mcheck\-zero\-division\c
3109 .B \-mocs\-debug\-info
3111 .B \-mno\-ocs\-debug\-info
3112 Include (or omit) additional debugging information (about
3113 registers used in each stack frame) as specified in the 88Open Object
3114 Compatibility Standard, \*(lqOCS\*(rq. This extra information is not needed
3115 by GDB. The default for DG/UX, SVr4, and Delta 88 SVr3.2 is to
3116 include this information; other 88k configurations omit this information
3119 .B \-mocs\-frame\-position
3121 .B \-mno\-ocs\-frame\-position
3122 Force (or do not require) register values to be stored in a particular
3123 place in stack frames, as specified in OCS. The DG/UX, Delta88 SVr3.2,
3124 and BCS configurations use `\|\c
3125 .B \-mocs\-frame\-position\c
3127 configurations have the default `\|\c
3128 .B \-mno\-ocs\-frame\-position\c
3131 .B \-moptimize\-arg\-area
3133 .B \-mno\-optimize\-arg\-area
3134 Control how to store function arguments in stack frames.
3136 .B \-moptimize\-arg\-area\c
3137 \&\|' saves space, but may break some
3138 debuggers (not GDB). `\|\c
3139 .B \-mno\-optimize\-arg\-area\c
3140 \&\|' conforms better to
3141 standards. By default GCC does not optimize the argument area.
3143 .BI "\-mshort\-data\-" "num"
3145 Generate smaller data references by making them relative to \c
3148 which allows loading a value using a single instruction (rather than the
3149 usual two). You control which data references are affected by
3152 \& with this option. For example, if you specify
3154 .B \-mshort\-data\-512\c
3155 \&\|', then the data references affected are those
3156 involving displacements of less than 512 bytes.
3158 .B \-mshort\-data\-\c
3161 \&\|' is not effective for \c
3166 .B \-mserialize-volatile
3168 .B \-mno-serialize-volatile
3169 Do, or do not, generate code to guarantee sequential consistency of
3170 volatile memory references.
3172 GNU CC always guarantees consistency by default, for the preferred
3173 processor submodel. How this is done depends on the submodel.
3175 The m88100 processor does not reorder memory references and so always
3176 provides sequential consistency. If you use `\|\c
3179 not generate any special instructions for sequential consistency.
3181 The order of memory references made by the m88110 processor does not
3182 always match the order of the instructions requesting those references.
3183 In particular, a load instruction may execute before a preceding store
3184 instruction. Such reordering violates sequential consistency of
3185 volatile memory references, when there are multiple processors. When
3190 \&\|', GNU CC generates special
3191 instructions when appropriate, to force execution in the proper order.
3193 The extra code generated to guarantee consistency may affect the
3194 performance of your application. If you know that you can safely forgo
3195 this guarantee, you may use the option `\|\c
3196 .B \-mno-serialize-volatile\c
3199 If you use the `\|\c
3201 \&\|' option but require sequential consistency
3202 when running on the m88110 processor, you should use
3204 .B \-mserialize-volatile\c
3212 \&\|') or off (`\|\c
3214 \&\|') compiler extensions
3215 related to System V release 4 (SVr4). This controls the following:
3218 Which variant of the assembler syntax to emit (which you can select
3219 independently using `\|\c
3220 .B \-mversion\-03.00\c
3226 \&\|' makes the C preprocessor recognize `\|\c
3233 \&\|' makes GCC issue additional declaration directives used in
3238 \&\|' is the default for all m88K configurations except
3239 the SVr4 configuration.
3241 .B \-mtrap\-large\-shift
3243 .B \-mhandle\-large\-shift
3244 Include code to detect bit-shifts of more than 31 bits; respectively,
3245 trap such shifts or emit code to handle them properly. By default GCC
3246 makes no special provision for large bit shifts.
3248 .B \-muse\-div\-instruction
3249 Very early models of the 88K architecture didn't have a divide
3250 instruction, so GCC avoids that instruction by default. Use this option
3251 to specify that it's safe to use the divide instruction.
3253 .B \-mversion\-03.00
3254 In the DG/UX configuration, there are two flavors of SVr4. This option
3257 to select whether the hybrid-COFF or real-ELF
3258 flavor is used. All other configurations ignore this option.
3260 .B \-mwarn\-passed\-structs
3261 Warn when a function passes a struct as an argument or result.
3262 Structure-passing conventions have changed during the evolution of the C
3263 language, and are often the source of portability problems. By default,
3264 GCC issues no such warning.
3266 These options are defined for the IBM RS6000:
3270 .B \-mno\-fp\-in\-toc
3271 Control whether or not floating-point constants go in the Table of
3272 Contents (TOC), a table of all global variable and function addresses. By
3273 default GCC puts floating-point constants there; if the TOC overflows,
3275 .B \-mno\-fp\-in\-toc\c
3276 \&\|' will reduce the size of the TOC, which may avoid
3281 \&\|' options are defined for the IBM RT PC:
3284 Use an in-line code sequence for integer multiplies. This is the
3287 .B \-mcall\-lib\-mul
3290 \& for integer multiples.
3292 .B \-mfull\-fp\-blocks
3293 Generate full-size floating point data blocks, including the minimum
3294 amount of scratch space recommended by IBM. This is the default.
3296 .B \-mminimum\-fp\-blocks
3297 Do not include extra scratch space in floating point data blocks. This
3298 results in smaller code, but slower execution, since scratch space must
3299 be allocated dynamically.
3301 .B \-mfp\-arg\-in\-fpregs
3302 Use a calling sequence incompatible with the IBM calling convention in
3303 which floating point arguments are passed in floating point registers.
3308 \& will not work with
3309 floating point operands if this option is specified.
3311 .B \-mfp\-arg\-in\-gregs
3312 Use the normal calling convention for floating point arguments. This is
3315 .B \-mhc\-struct\-return
3316 Return structures of more than one word in memory, rather than in a
3317 register. This provides compatibility with the MetaWare HighC (hc)
3319 .B \-fpcc\-struct\-return\c
3320 \&\|' for compatibility with the
3321 Portable C Compiler (pcc).
3323 .B \-mnohc\-struct\-return
3324 Return some structures of more than one word in registers, when
3325 convenient. This is the default. For compatibility with the
3326 IBM-supplied compilers, use either `\|\c
3327 .B \-fpcc\-struct\-return\c
3330 .B \-mhc\-struct\-return\c
3335 \&\|' options are defined for the MIPS family of computers:
3337 .BI "\-mcpu=" "cpu-type"
3338 Assume the defaults for the machine type
3341 scheduling instructions. The default
3345 which picks the longest cycles times for any of the machines, in order
3346 that the code run at reasonable rates on all MIPS cpu's. Other
3355 While picking a specific
3357 will schedule things appropriately for that particular chip, the
3358 compiler will not generate any code that does not meet level 1 of the
3359 MIPS ISA (instruction set architecture) without the
3363 switches being used.
3366 Issue instructions from level 2 of the MIPS ISA (branch likely, square
3367 root instructions). The
3371 switch must be used in conjunction with
3375 Issue instructions from level 3 of the MIPS ISA (64 bit instructions).
3378 switch must be used in conjunction with
3386 These options don't work at present.
3389 Generate code for the MIPS assembler, and invoke
3391 to add normal debug information. This is the default for all
3392 platforms except for the OSF/1 reference platform, using the OSF/rose
3393 object format. If any of the
3398 switches are used, the
3400 program will encapsulate the stabs within MIPS ECOFF.
3403 Generate code for the GNU assembler. This is the default on the OSF/1
3404 reference platform, using the OSF/rose object format.
3411 switch says to output code using the MIPS software names for the
3412 registers, instead of the hardware names (ie,
3416 The GNU assembler does not support the
3418 switch, and the MIPS assembler will be instructed to run the MIPS C
3419 preprocessor over the source file. The
3428 switch says to write all of the data declarations before the
3429 instructions in the text section, to all the MIPS assembler to
3430 generate one word memory references instead of using two words for
3431 short global or static data items. This is on by default if
3432 optimization is selected.
3437 For each non-inline function processed, the
3439 switch causes the compiler to emit one line to the standard error file
3440 to print statistics about the program (number of registers saved,
3448 switch makes all block moves call the appropriate string function
3452 instead of possibly generating inline code.
3456 .B \-mno\-mips\-tfile
3458 .B \-mno\-mips\-tfile
3459 switch causes the compiler not postprocess the object file with the
3461 program, after the MIPS assembler has generated it to add debug
3464 is not run, then no local variables will be available to the debugger.
3469 objects will have the temporary file names passed to the assembler
3470 embedded in the object file, which means the objects will not compare
3474 Generate output containing library calls for floating point.
3477 the requisite libraries are not part of GNU CC. Normally the
3478 facilities of the machine's usual C compiler are used, but this can't
3479 be done directly in cross-compilation. You must make your own
3480 arrangements to provide suitable library functions for cross-compilation.
3483 Generate output containing floating point instructions. This is the
3484 default if you use the unmodified sources.
3489 bit in the status word is on, and that there are 32 64-bit floating
3490 point registers, instead of 32 32-bit floating point registers. You
3491 must also specify the
3498 Assume that there are 32 32-bit floating point registers. This is the
3504 Emit (or do not emit) the
3509 pseudo operations that some System V.4 ports use for position
3517 switch says to put pointers to extern references into the data section
3518 and load them up, rather than put the references in the text section.
3519 This option does not work at present.
3522 Put global and static items less than or equal to
3524 bytes into the small data or bss sections instead of the normal data
3525 or bss section. This allows the assembler to emit one word memory
3526 reference instructions based on the global pointer
3530 instead of the normal two words used. By default,
3532 is 8 when the MIPS assembler is used, and 0 when the GNU
3533 assembler is used. The
3535 switch is also passed to the assembler and linker. All modules should
3536 be compiled with the same
3541 Tell the MIPS assembler to not run its preprocessor over user
3542 assembler files (with a `\|\c
3544 \&\|' suffix) when assembling them.
3548 \&\|' options are defined for the Intel 80386 family of computers:
3553 Control whether or not code is optimized for a 486 instead of an
3554 386. Code generated for a 486 will run on a 386 and vice versa.
3557 Generate output containing library calls for floating point.
3559 the requisite libraries are not part of GNU CC.
3560 Normally the facilities of the machine's usual C compiler are used, but
3561 this can't be done directly in cross-compilation. You must make your
3562 own arrangements to provide suitable library functions for
3565 On machines where a function returns floating point results in the 80387
3566 register stack, some floating point opcodes may be emitted even if
3571 .B \-mno-fp-ret-in-387
3572 Do not use the FPU registers for return values of functions.
3574 The usual calling convention has functions return values of types
3578 \& in an FPU register, even if there
3579 is no FPU. The idea is that the operating system should emulate
3583 .B \-mno-fp-ret-in-387\c
3584 \&\|' causes such values to be returned
3585 in ordinary CPU registers instead.
3589 \&\|' options are defined for the HPPA family of computers:
3592 Generate code for a PA 1.0 processor.
3595 Generate code for a PA 1.1 processor.
3598 Generate code which is suitable for use in kernels. Specifically, avoid
3600 \& instructions in which one of the arguments is the DP register;
3603 \& instructions instead. This avoids a rather serious
3604 bug in the HP-UX linker.
3607 Generate code which allows calls to functions greater than 256K away from
3608 the caller when the caller and callee are in the same source file. Do
3609 not turn this option on unless code refuses to link with \*(lqbranch out of
3610 range errors\*('' from the linker.
3612 .B \-mdisable-fpregs
3613 Prevent floating point registers from being used in any manner. This is
3614 necessary for compiling kernels which perform lazy context switching of
3615 floating point registers. If you use this option and attempt to perform
3616 floating point operations, the compiler will abort.
3618 .B \-mdisable-indexing
3619 Prevent the compiler from using indexing address modes. This avoids some
3620 rather obscure problems when compiling MIG generated code under MACH.
3622 .B \-mtrailing-colon
3623 Add a colon to the end of label definitions (for ELF assemblers).
3627 \&\|' options are defined for the Intel 80960 family of computers:
3629 .BI "\-m" "cpu-type"
3630 Assume the defaults for the machine type
3632 for instruction and addressing-mode availability and alignment.
3651 option indicates that the processor does support
3652 floating-point instructions. The
3655 that floating-point support should not be assumed.
3657 .B \-mleaf\-procedures
3659 .B \-mno\-leaf\-procedures
3660 Do (or do not) attempt to alter leaf procedures to be callable with the
3662 instruction as well as
3664 This will result in more
3665 efficient code for explicit calls when the
3668 substituted by the assembler or linker, but less efficient code in other
3669 cases, such as calls via function pointers, or using a linker that doesn't
3670 support this optimization.
3674 .B \-mno\-tail\-call
3675 Do (or do not) make additional attempts (beyond those of the
3676 machine-independent portions of the compiler) to optimize tail-recursive
3677 calls into branches. You may not want to do this because the detection of
3678 cases where this is not valid is not totally complete. The default is
3679 .BR \-mno\-tail\-call .
3683 .B \-mno\-complex\-addr
3684 Assume (or do not assume) that the use of a complex addressing mode is a
3685 win on this implementation of the i960. Complex addressing modes may not
3686 be worthwhile on the K-series, but they definitely are on the C-series.
3687 The default is currently
3689 for all processors except
3694 .B \-mno\-code\-align
3695 Align code to 8-byte boundaries for faster fetching (or don't bother).
3696 Currently turned on by default for C-series implementations only.
3703 Enable compatibility with iC960 v2.0 or v3.0.
3708 Enable compatibility with the iC960 assembler.
3712 .B \-mno\-strict\-align
3713 Do not permit (do permit) unaligned accesses.
3716 Enable structure-alignment compatibility with Intel's gcc release version
3717 1.3 (based on gcc 1.37). Currently this is buggy in that
3719 is always assumed as well, and cannot be turned off.
3723 \&\|' options are defined for the DEC Alpha implementations:
3728 Use (do not use) the hardware floating-point instructions for
3729 floating-point operations. When \c
3734 \&\|' will be used to perform floating-point
3735 operations. Unless they are replaced by routines that emulate the
3736 floating-point operations, or compiled in such a way as to call such
3737 emulations routines, these routines will issue floating-point
3738 operations. If you are compiling for an Alpha without floating-point
3739 operations, you must ensure that the library is built so as not to call
3742 Note that Alpha implementations without floating-point operations are
3743 required to have floating-point registers.
3748 Generate code that uses (does not use) the floating-point register set.
3752 \&. If the floating-point
3753 register set is not used, floating point operands are passed in integer
3754 registers as if they were integers and floating-point results are passed
3755 in $0 instead of $f0. This is a non-standard calling sequence, so any
3756 function with a floating-point argument or return value called by code
3759 \& must also be compiled with that
3762 A typical use of this option is building a kernel that does not use,
3763 and hence need not save and restore, any floating-point registers.
3765 These additional options are available on System V Release 4 for
3766 compatibility with other compilers on those systems:
3771 \& accepts the option `\|\c
3774 it to the system linker), for compatibility with other compilers.
3775 However, we suggest you use `\|\c
3780 appropriate, instead of supplying linker options on the \c
3785 Identify the versions of each tool used by the compiler, in a
3787 \& assembler directive in the output.
3790 Refrain from adding \c
3792 \& directives to the output file (this is
3796 Search the directories \c
3798 \&, and no others, for libraries
3799 specified with `\|\c
3801 \&\|'. You can separate directory entries in
3803 \& from one another with colons.
3806 Look in the directory \c
3808 \& to find the M4 preprocessor.
3809 The assembler uses this option.
3810 .SH CODE GENERATION OPTIONS
3811 These machine-independent options control the interface conventions
3812 used in code generation.
3814 Most of them begin with `\|\c
3816 \&\|'. These options have both positive and negative forms; the negative form
3819 \&\|' would be `\|\c
3821 \&\|'. In the table below, only
3822 one of the forms is listed\(em\&the one which is not the default. You
3823 can figure out the other form by either removing `\|\c
3828 .B \-fnonnull\-objects
3829 Assume that objects reached through references are not null
3832 Normally, GNU C++ makes conservative assumptions about objects reached
3833 through references. For example, the compiler must check that \c
3835 is not null in code like the following:
3840 Checking that references of this sort have non-null values requires
3841 extra code, however, and it is unnecessary for many programs. You can
3843 .B \-fnonnull-objects\c
3844 \&\|' to omit the checks for null, if your
3845 program doesn't require checking.
3847 .B \-fpcc\-struct\-return
3848 Use the same convention for returning \c
3852 values that is used by the usual C compiler on your system. This
3853 convention is less efficient for small structures, and on many
3854 machines it fails to be reentrant; but it has the advantage of
3855 allowing intercallability between GCC-compiled code and PCC-compiled
3858 .B \-freg\-struct\-return
3859 Use the convention that
3863 values are returned in registers when possible. This is more
3864 efficient for small structures than
3865 .BR \-fpcc\-struct\-return .
3867 If you specify neither
3868 .B \-fpcc\-struct\-return
3870 .BR \-freg\-struct\-return ,
3871 GNU CC defaults to whichever convention is standard for the target.
3872 If there is no standard convention, GNU CC defaults to
3873 .BR \-fpcc\-struct\-return .
3878 \& type only as many bytes as it needs for the
3879 declared range of possible values. Specifically, the \c
3882 will be equivalent to the smallest integer type which has enough room.
3885 Use the same size for
3892 Requests that the data and non-\c
3894 \& variables of this
3895 compilation be shared data rather than private data. The distinction
3896 makes sense only on certain operating systems, where shared data is
3897 shared between processes running the same program, while private data
3898 exists in one copy per process.
3901 Allocate even uninitialized global variables in the bss section of the
3902 object file, rather than generating them as common blocks. This has the
3903 effect that if the same variable is declared (without \c
3906 two different compilations, you will get an error when you link them.
3907 The only reason this might be useful is if you wish to verify that the
3908 program will work on other systems which always work this way.
3915 .B \-fno\-gnu\-linker
3916 Do not output global initializations (such as C++ constructors and
3917 destructors) in the form used by the GNU linker (on systems where the GNU
3918 linker is the standard method of handling them). Use this option when
3919 you want to use a non-GNU linker, which also requires using the
3921 \& program to make sure the system linker includes
3922 constructors and destructors. (\c
3924 \& is included in the GNU CC
3925 distribution.) For systems which \c
3932 \& is configured to do this automatically.
3934 .B \-finhibit-size-directive
3937 \& assembler directive, or anything else that
3938 would cause trouble if the function is split in the middle, and the
3939 two halves are placed at locations far apart in memory. This option is
3940 used when compiling `\|\c
3942 \&\|'; you should not need to use it
3946 Put extra commentary information in the generated assembly code to
3947 make it more readable. This option is generally only of use to those
3948 who actually need to read the generated assembly code (perhaps while
3949 debugging the compiler itself).
3952 Consider all memory references through pointers to be volatile.
3954 .B \-fvolatile\-global
3955 Consider all memory references to extern and global data items to
3959 If supported for the target machines, generate position-independent code,
3960 suitable for use in a shared library.
3963 If supported for the target machine, emit position-independent code,
3964 suitable for dynamic linking, even if branches need large displacements.
3966 .BI "\-ffixed\-" "reg"
3967 Treat the register named \c
3969 \& as a fixed register; generated code
3970 should never refer to it (except perhaps as a stack pointer, frame
3971 pointer or in some other fixed role).
3974 \& must be the name of a register. The register names accepted
3975 are machine-specific and are defined in the \c
3977 macro in the machine description macro file.
3979 This flag does not have a negative form, because it specifies a
3982 .BI "\-fcall\-used\-" "reg"
3983 Treat the register named \c
3985 \& as an allocable register that is
3986 clobbered by function calls. It may be allocated for temporaries or
3987 variables that do not live across a call. Functions compiled this way
3988 will not save and restore the register \c
3992 Use of this flag for a register that has a fixed pervasive role in the
3993 machine's execution model, such as the stack pointer or frame pointer,
3994 will produce disastrous results.
3996 This flag does not have a negative form, because it specifies a
3999 .BI "\-fcall\-saved\-" "reg"
4000 Treat the register named \c
4002 \& as an allocable register saved by
4003 functions. It may be allocated even for temporaries or variables that
4004 live across a call. Functions compiled this way will save and restore
4009 Use of this flag for a register that has a fixed pervasive role in the
4010 machine's execution model, such as the stack pointer or frame pointer,
4011 will produce disastrous results.
4013 A different sort of disaster will result from the use of this flag for
4014 a register in which function values may be returned.
4016 This flag does not have a negative form, because it specifies a
4021 \&\|' directives are supported for GNU C++, to permit using the same
4022 header file for two purposes: as a definition of interfaces to a given
4023 object class, and as the full definition of the contents of that object class.
4025 .B #pragma interface
4027 Use this directive in header files that define object classes, to save
4028 space in most of the object files that use those classes. Normally,
4029 local copies of certain information (backup copies of inline member
4030 functions, debugging information, and the internal tables that
4031 implement virtual functions) must be kept in each object file that
4032 includes class definitions. You can use this pragma to avoid such
4033 duplication. When a header file containing `\|\c
4034 .B #pragma interface\c
4035 \&\|' is included in a compilation, this auxiliary information
4036 will not be generated (unless the main input source file itself uses
4038 .B #pragma implementation\c
4039 \&\|'). Instead, the object files will contain references to be
4040 resolved at link time.
4042 .B #pragma implementation
4044 \fB#pragma implementation "\fP\fIobjects\fP\fB.h"\fP
4046 Use this pragma in a main input file, when you want full output from
4047 included header files to be generated (and made globally visible).
4048 The included header file, in turn, should use `\|\c
4049 .B #pragma interface\c
4051 Backup copies of inline member functions, debugging information, and
4052 the internal tables used to implement virtual functions are all
4053 generated in implementation files.
4056 .B #pragma implementation\c
4057 \&\|' with no argument, it applies to an include file with the same
4058 basename as your source file; for example, in `\|\c
4061 .B #pragma implementation\c
4062 \&\|' by itself is equivalent to `\|\c
4064 #pragma implementation "allclass.h"\c
4065 \&\|'. Use the string argument if you want a single implementation
4066 file to include code from multiple header files.
4068 There is no way to split up the contents of a single header file into
4069 multiple implementation files.
4072 .ta \w'LIBDIR/g++\-include 'u
4073 file.c C source file
4074 file.h C header (preprocessor) file
4075 file.i preprocessed C source file
4076 file.C C++ source file
4077 file.cc C++ source file
4078 file.cxx C++ source file
4079 file.m Objective-C source file
4080 file.s assembly language file
4082 a.out link edited output
4083 \fITMPDIR\fR/cc\(** temporary files
4084 \fILIBDIR\fR/cpp preprocessor
4085 \fILIBDIR\fR/cc1 compiler for C
4086 \fILIBDIR\fR/cc1plus compiler for C++
4087 \fILIBDIR\fR/collect linker front end needed on some machines
4088 \fILIBDIR\fR/libgcc.a GCC subroutine library
4089 /lib/crt[01n].o start-up routine
4090 \fILIBDIR\fR/ccrt0 additional start-up routine for C++
4091 /lib/libc.a standard C library, see
4093 /usr/include standard directory for \fB#include\fP files
4094 \fILIBDIR\fR/include standard gcc directory for \fB#include\fP files
4095 \fILIBDIR\fR/g++\-include additional g++ directory for \fB#include\fP
4100 .B /usr/local/lib/\c
4101 .IR machine / version .
4104 comes from the environment variable
4112 Normally the exit status is 0, if compilation or link edit are successful,
4113 and nonzero else. The option
4115 treats each warning as an error.
4117 cpp(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1).
4119 .RB "`\|" gcc "\|', `\|" cpp \|',
4120 .RB "`\|" as "\|', `\|" ld \|',
4128 Using and Porting GNU CC (for version 2.0)\c
4129 , Richard M. Stallman;
4131 The C Preprocessor\c
4132 , Richard M. Stallman;
4134 Debugging with GDB: the GNU Source-Level Debugger\c
4135 , Richard M. Stallman and Roland H. Pesch;
4137 Using as: the GNU Assembler\c
4138 , Dean Elsner, Jay Fenlason & friends;
4140 ld: the GNU linker\c
4141 , Steve Chamberlain and Roland Pesch.
4143 For instructions on reporting bugs, see the GCC manual.
4147 1991, 1992, 1993 Free Software Foundation, Inc.
4149 Permission is granted to make and distribute verbatim copies of
4150 this manual provided the copyright notice and this permission notice
4151 are preserved on all copies.
4153 Permission is granted to copy and distribute modified versions of this
4154 manual under the conditions for verbatim copying, provided that the
4155 entire resulting derived work is distributed under the terms of a
4156 permission notice identical to this one.
4158 Permission is granted to copy and distribute translations of this
4159 manual into another language, under the above conditions for modified
4160 versions, except that this permission notice may be included in
4161 translations approved by the Free Software Foundation instead of in
4162 the original English.
4164 See the GNU CC Manual for the contributors to GNU CC.