gcc,g++-GNU工程的C和C++编译器(egcs-1.1.2)总览(SYNOPSIS)gcc[option|filename]...g++[option|filename]...警告(WARNING)本手册页内容摘自GNUC编译器的完整文档,仅限于解释选项的含义.除非有人自愿维护,否则本手册页不再更新.如果发现手册页和软件之间有所矛盾,请查对Info文件,Info文件是权威文档.如果我们发觉本手册页的内容由于过时而导致明显的混乱和抱怨时,我们就停止发布它.不可能有其他选择,象更新Info文件同时更新man手册,因为其他维护GNUCC的工作没有留给我们时间做这个.GNU工程认为man手册是过时产物,应该把时间用到别的地方.如果需要完整和最新的文档,请查阅Info文件`gcc'或UsingandPortingGNUCC(forversion2.0)(使用和移植GNUCC2.0)手册.二者均来自Texinfo原文件gcc.texinfo.描述(DESCRIPTION)C和C++编译器是集成的.他们都要用四个步骤中的一个或多个处理输入文件:预处理(preprocessing),编译(compilation),汇编(assembly)和连接(linking).源文件后缀名标识源文件的语言,但是对编译器来说,后缀名控制着缺省设定:gcc认为预处理后的文件(.i)是C文件,并且设定C形式的连接.g++认为预处理后的文件(.i)是C++文件,并且设定C++形式的连接.源文件后缀名指出语言种类以及后期的操作:.cC源程序;预处理,编译,汇编.CC++源程序;预处理,编译,汇编.ccC++源程序;预处理,编译,汇编.cxxC++源程序;预处理,编译,汇编.mObjective-C源程序;预处理,编译,汇编.i预处理后的C文件;编译,汇编.ii预处理后的C++文件;编译,汇编.s汇编语言源程序;汇编.S汇编语言源程序;预处理,汇编.h预处理器文件;通常不出现在命令行上其他后缀名的文件被传递给连接器(linker).通常包括:.o目标文件(Objectfile).a归档库文件(Archivefile)除非使用了-c,-S,或-E选项(或者编译错误阻止了完整的过程),否则连接总是最后的步骤.在连接阶段中,所有对应于源程序的.o文件,-l库文件,无法识别的文件名(包括指定的.o目标文件和.a库文件)按命令行中的顺序传递给连接器.选项(OPTIONS)选项必须分立给出:`-dr'完全不同于`-d-r'.大多数`-f'和`-W'选项有两个相反的格式:-fname和-fno-name(或-Wname和-Wno-name).这里只列举不是默认选项的格式.下面是所有选项的摘要,按类型分组,解释放在后面的章节中.总体选项(OverallOption)-c-S-E-ofile-pipe-v-xlanguage语言选项(LanguageOption)-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警告选项(WarningOption)-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调试选项(DebuggingOption)-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优化选项(OptimizationOption)-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预处理器选项(PreprocessorOption)-Aassertion-C-dD-dM-dN-Dmacro[=defn]-E-H-idirafterdir-includefile-imacrosfile-iprefixfile-iwithprefixdir-M-MD-MM-MMD-nostdinc-P-Umacro-undef汇编器选项(AssemblerOption)-Wa,option连接器选项(LinkerOption)-llibrary-nostartfiles-nostdlib-static-shared-symbolic-Xlinkeroption-Wl,option-usymbol目录选项(DirectoryOption)-Bprefix-Idir-I--Ldir目标机选项(TargetOption)-bmachine-Vversion配置相关选项(ConfigurationDependentOption)M680x0选项-m68000-m68020-m68020-40-m68030-m68040-m68881-mbitfield-mc68000-mc68020-mfpa-mnobitfield-mrtd-mshort-msoft-floatVAX选项-mg-mgnu-munixSPARC选项-mepilogue-mfpu-mhard-float-mno-fpu-mno-epilogue-msoft-float-msparclite-mv8-msupersparc-mcypressConvex选项-margcount-mc1-mc2-mnoargcountAMD29K选项-m29000-m29050-mbw-mdw-mkernel-registers-mlarge-mnbw-mnodw-msmall-mstack-check-muser-registersM88K选项-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-structsRS6000选项-mfp-in-toc-mno-fop-in-tocRT选项-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-returnMIPS选项-mcpu=cputype-mips2-mips3-mint64-mlong64-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-Gnum-nocppi386选项-m486-mno-486-msoft-float-mno-fp-ret-in-387HPPA选项-mpa-risc-1-0-mpa-risc-1-1-mkernel-mshared-libs-mno-shared-libs-mlong-calls-mdisable-fpregs-mdisable-indexing-mtrailing-coloni960选项-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-alignDECAlpha选项-mfp-regs-mno-fp-regs-mno-soft-float-msoft-floatSystemV选项-G-Qy-Qn-YP,paths-Ym,dir代码生成选项(CodeGenerationOption)-fcall-saved-reg-fcall-used-reg-ffixed-reg-finhibit-size-directive-fnonnull-objects-fno-comm