Contents|Index|Previous|Next

GNU CC Command Options

The following documentation discusses the GNU CC command options. See Options Summary for a list of options, grouped by type.

- OPTIONS CONTROLLING THE KIND OF OUTPUT
- COMPILING C++ PROGRAMS
- OPTIONS CONTROLLING C DIALECT
- OPTIONS THAT CONTROL C++ DIALECT
- OPTIONS TO REQUEST OR SUPPRESS WARNINGS
- OPTIONS FOR DEBUGGING YOUR PROGRAM OR GNU CC
- OPTIONS THAT CONTROL OPTIMIZATION
- OPTIONS CONTROLLING THE PREPROCESSOR
- PASSING OPTIONS TO THE ASSEMBLER
- OPTIONS FOR LINKING
- OPTIONS FOR DIRECTORY SEARCH
- SPECIFYING TARGET MACHINE AND COMPILER VERSION
- HARDWARE MODELS AND CONFIGURATIONS

- M680x0 Options
- VAX Options
- SPARC Options
- Convex Options
- AMD29K Options
- ARM Options
- M88K Options
- IBM RS/6000 and PowerPC Options
- IBM RT Options
- MIPS Options
- Intel 386 Options
- HPPA Options
- Intel 960 Options
- DEC Alpha Options
- Clipper Options
- SH Options
- H8/300 Options
- System V Options

- OPTIONS FOR CODE GENERATION CONVENTIONS
- offset-info OPTION
- ENVIRONMENT VARIABLES AFFECTING GNU CC
- RUNNING protoize

When you invoke GNU CC, it normally does preprocessing, compilation, assembly and linking. The overall options allow you to stop this process at an intermediate stage. For example, the -c option says not to run the linker. Then the output consists of object files output by the assembler.

Other options are passed on to one stage of processing. Some options control the preprocessor and others the compiler itself. Yet other options control the assembler and linker; most of these are not documented here, since you rarely need to use any of them.

Most of the command line options that you can use with GNU CC are useful for C programs; when an option is only useful with another language (usually C++), the explanation says so explicitly. If the description for a particular option does not mention a source language, you can use that option with all supported languages.

See Compiling C++ Programs for a summary of special options for compiling C++ programs. The gcc program accepts options and filenames as operands. Many options have multi-letter names; therefore multiple single-letter options may not be grouped: -dr is very different from -d -r.

You can mix options and other arguments. For the most part, the order you use doesnt matter. Order does matter when you use several options of the same kind; for example, if you specify -L more than once, the directories are searched in the order specified.

Many options have long names starting with -f or with -W for example, -fforce-mem, -fstrength-reduce, -Wformat, and so on. Most of these have both positive and negative forms; the negative form of -ffoo would be -fno-foo. This documentation discusses only one of these two forms, whichever one is not the default.