龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > 软件开发 > C/C++开发 >

gcc manual page (一)

时间:2009-12-22 15:42来源:未知 作者:admin 点击:
分享到:
Linuxkb home - gcc manual page personalize help GCC Section: GNU Tools (1) Updated: 1998/08/29 Index Return to Main Contents -------------------------------------------------------------------------------- NAME gcc, g++ - GNU project C and

  Linuxkb home - gcc manual page

  

personalize

  

help

  

  

  

GCC

  

Section: GNU Tools (1)

  

Updated: 1998/08/29

  

Index Return to Main Contents

  

--------------------------------------------------------------------------------

  

  

NAME

  

gcc, g++ - GNU project C and C++ Compiler (egcs-1.1.2)

  

SYNOPSIS

  

gcc [ option filename ]...

  

g++ [ option filename ]...

  

WARNING

  

The information in this man page is an extract from the full documentation of the GNU C compiler, and is limited to the meaning of the options.

  

This man page is not kept up to date except when volunteers want to maintain it. If you find a discrepancy between the man page and the software, please check the Info file, which is the authoritative documentation.

  

  

If we find that the things in this man page that are out of date cause significant confusion or complaints, we will stop distributing the man page. The alternative, updating the man page when we update the Info file, is impossible because the rest of the work of maintaining GNU CC leaves us no time for that. The GNU project regards man pages as obsolete and should not let them take time away from other things.

  

  

For complete and current documentation, refer to the Info file `gcc' or the manual Using and Porting GNU CC (for version 2.0). Both are made from the Texinfo source file gcc.texinfo.

  

  

DESCRIPTION

  

The C and C++ compilers are integrated. Both process input files through one or more of four stages: preprocessing, compilation, assembly, and linking. Source filename suffixes identify the source language, but which name you use for the compiler governs default assumptions:

  

gcc

  

assumes preprocessed (.i) files are C and assumes C style linking.

  

g++

  

assumes preprocessed (.i) files are C++ and assumes C++ style linking.

  

Suffixes of source file names indicate the language and kind of processing to be done:

  

  

  

  

.c C source; preprocess, compile, assemble

  

.C C++ source; preprocess, compile, assemble

  

.cc C++ source; preprocess, compile, assemble

  

.cxx C++ source; preprocess, compile, assemble

  

.m Objective-C source; preprocess, compile, assemble

  

.i preprocessed C; compile, assemble

  

.ii preprocessed C++; compile, assemble

  

.s Assembler source; assemble

  

.S Assembler source; preprocess, assemble

  

.h Preprocessor file; not usually named on command line

  

  

  

  

Files with other suffixes are passed to the linker. Common cases include:

  

  

.o Object file

  

.a Archive file

  

  

  

Linking is always the last stage unless you use one of the -c, -S, or -E options to avoid it (or unless compilation errors stop the whole process). For the link stage, all .o files corresponding to source files, -l libraries, unrecognized filenames (including named .o object files and .a archives) are passed to the linker in command-line order.

  

  

  

OPTIONS

  

Options must be separate: `-dr' is quite different from `-d -r '.

  

Most `-f' and `-W' options have two contrary forms: -fname and -fno-name (or -Wname and -Wno-name). Only the non-default forms are shown here.

  

  

Here is a summary of all the options, grouped by type. EXPlanations are in the following sections.

  

  

Overall Options

  

  

-c -S -E -o file -pipe -v -x language

  

Language Options

  

-ansi -fall-virtual -fcond-mismatch -fdollars-in-identifiers -fenum-int-equiv -fexternal-templates -fno-asm -fno-builtin -fhosted -fno-hosted -ffreestanding -fno-freestanding -fno-strict-prototype -fsigned-bitfields -fsigned-char -fthis-is-variable -funsigned-bitfields -funsigned-char -fwritable-strings -traditional -traditional-cpp -trigraphs

  

Warning Options

  

-fsyntax-only -pedantic -pedantic-errors -w -W -Wall -Waggregate-return -Wcast-align -Wcast-qual -Wchar-subscript -Wcomment -Wconversion -Wenum-clash -Werror -Wformat -Wid-clash-len -Wimplicit -Wimplicit-int -Wimplicit-function-declaration -Winline -Wlong-long -Wmain -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wno-import -Wparentheses -Wpointer-arith -Wredundant-decls -Wreturn-type -Wshadow -Wstrict-prototypes -Wswitch -Wtemplate-debugging -Wtraditional -Wtrigraphs -Wuninitialized -Wunused -Wwrite-strings

  

Debugging Options

  

-a -dletters -fpretend-float -g -glevel -gcoff -gxcoff -gxcoff+ -gdwarf -gdwarf+ -gstabs -gstabs+ -ggdb -p -pg -save-temps -print-file-name=library -print-libgcc-file-name -print-prog-name=program

  

Optimization Options

  

-fcaller-saves -fcse-follow-jumps -fcse-skip-blocks -fdelayed-branch -felide-constrUCtors -fexpensive-optimizations -ffast-math -ffloat-store -fforce-addr -fforce-mem -finline-functions -fkeep-inline-functions -fmemoize-lookups -fno-default-inline -fno-defer-pop -fno-function-cse -fno-inline -fno-peephole -fomit-frame-pointer -frerun-cse-after-loop -fschedule-insns -fschedule-insns2 -fstrength-reduce -fthread-jumps -funroll-all-loops -funroll-loops -O -O2 -O3

  

Preprocessor Options

  

-Aassertion -C -dD -dM -dN -Dmacro[=defn] -E -H -idirafter dir -include file -imacros file -iprefix file -iwithprefix dir -M -MD -MM -MMD -nostdinc -P -Umacro -undef

  

Assembler Option

  

-Wa,option

  

Linker Options

  

-llibrary -nostartfiles -nostdlib -static -shared -symbolic -Xlinker option -Wl,option -u symbol

  

Directory Options

  

-Bprefix -Idir -I- -Ldir

  

Target Options

  

-b machine -V version

  

Configuration Dependent Options

  

M680x0 Options

  

  

-m68000 -m68020 -m68020-40 -m68030 -m68040 -m68881 -mbitfield -mc68000 -mc68020 -mfpa -mnobitfield -mrtd -mshort -msoft-float

  

VAX Options

  

-mg -mgnu -munix

  

  

SPARC Options

  

-mepilogue -mfpu -mhard-float -mno-fpu -mno-epilogue -msoft-float -msparclite -mv8 -msupersparc -mcypress

  

  

Convex Options

  

-margcount -mc1 -mc2 -mnoargcount

  

  

AMD29K Options

  

-m29000 -m29050 -mbw -mdw -mkernel-registers -mlarge -mnbw -mnodw -msmall -mstack-check -muser-registers

  

  

M88K Options

  

-m88000 -m88100 -m88110 -mbig-pic -mcheck-zero-division -mhandle-large-shift -midentify-revision -mno-check-zero-division -mno-ocs-debug-info -mno-ocs-frame-position -mno-optimize-arg-area -mno-serialize-volatile -mno-underscores -mocs-debug-info -mocs-frame-position -moptimize-arg-area -mserialize-volatile -mshort-data-num -msvr3 -msvr4 -mtrap-large-shift -muse-div-instruction -mversion-03.00 -mwarn-passed-structs

  

  

RS6000 Options

  

-mfp-in-toc -mno-fop-in-toc

  

  

RT Options

  

-mcall-lib-mul -mfp-arg-in-fpregs -mfp-arg-in-gregs -mfull-fp-blocks -mhc-struct-return -min-line-mul -mminimum-fp-blocks -mnohc-struct-return

  

  

MIPS Options

  

-mcpu=cpu type -mips2 -mips3 -mint64 -mlong64 -mlonglong128 -mmips-as -mgas -mrnames -mno-rnames -mgpopt -mno-gpopt -mstats -mno-stats -mmemcpy -mno-memcpy -mno-mips-tfile -mmips-tfile -msoft-float -mhard-float -mabicalls -mno-abicalls -mhalf-pic -mno-half-pic -G num -nocpp

  

  

i386 Options

  

-m486 -mno-486 -msoft-float -mno-fp-ret-in-387

  

  

HPPA Options

  

-mpa-risc-1-0 -mpa-risc-1-1 -mkernel -mshared-libs -mno-shared-libs -mlong-calls -mdisable-fpregs -mdisable-indexing -mtrailing-colon

  

  

i960 Options

  

-mcpu-type -mnumerics -msoft-float -mleaf-procedures -mno-leaf-procedures -mtail-call -mno-tail-call -mcomplex-addr -mno-complex-addr -mcode-align -mno-code-align -mic-compat -mic2.0-compat -mic3.0-compat -masm-compat -mintel-asm -mstrict-align -mno-strict-align -mold-align -mno-old-align

  

  

DEC

  

精彩图集

赞助商链接