GCC中文手册

GCC
Section: GNU Tools (1)GCC
Section: GNU Tools (1)
Updated: 2003/12/05
Index Return to Main Contents 
NAME
gcc,g++-GNU工程的C和C++编译器(egcs-1.1.2) 
总览(SYNOPSIS)
gcc[option|filename ]...
g++[option|filename ]...

警告(WARNING)
本手册页内容摘自GNU C编译器的完整文档,仅限于解释选项的含义.

除非有人自愿维护,否则本手册页不再更新.如果发现手册页和软件之间有所矛盾,请查对Info文件, Info文件是权威文档.

如果我们发觉本手册页的内容由于过时而导致明显的混乱和抱怨时,我们就停止发布它.不可能有其他选择,象更新Info文件同时更新man手册,因为其他维护GNU CC的工作没有留给我们时间做这个. GNU工程认为man手册是过时产物,应该把时间用到别的地方.

如果需要完整和最新的文档,请查阅Info文件`gcc'或Using and Porting GNU CC (for version 2.0) (使用和移植GNU CC 2.0) 手册.二者均来自Texinfo原文件 gcc.texinfo.

描述(DESCRIPTION)
C和C++编译器是集成的.他们都要用四个步骤中的一个或多个处理输入文件: 预处理(preprocessing),编译(compilation), 汇编(assembly)和连接(linking).源文件后缀名标识源文件的 语言,但是对编译器来说,后缀名控制着缺省设定:

gcc
    认为预处理后的文件(.i)是C文件,并且设定C形式的连接.
g++
    认为预处理后的文件(.i)是C++文件,并且设定C++形式的连接.

源文件后缀名指出语言种类以及后期的操作:

.c      C源程序;预处理,编译,汇编
.C      C++源程序;预处理,编译,汇编
.cc     C++源程序;预处理,编译,汇编
.cxx    C++源程序;预处理,编译,汇编
.m      Objective-C源程序;预处理,编译,汇编
.i     预处理后的C文件;编译,汇编
.ii    预处理后的C++文件;编译,汇编
.s     汇编语言源程序;汇编
.S     汇编语言源程序;预处理,汇编
.h     预处理器文件;通常不出现在命令行上

 

其他后缀名的文件被传递给连接器(linker).通常包括:

.o     目标文件(Object file)
.a     归档库文件(Archive file)

 

除非使用了-c, -S,或-E选项(或者编译错误阻止了完整的过程),否则连接总是 最后的步骤.在连接阶段中,所有对应于源程序的.o文件, -l库文件,无法识别的文件名(包括指定的 .o目标文件和.a库文件)按命令行中的顺序传递给连接器.

选项(OPTIONS)
选项必须分立给出: `-dr'完全不同于`-d -r '.

大多数`-f'和`-W'选项有两个相反的格式: -fname和 -fno-name (或-Wname和-Wno-name).这里 只列举不是默认选项的格式.

下面是所有选项的摘要,按类型分组,解释放在后面的章节中.

总体选项(Overall Option)

    -c -S -E -o file -pipe -v -x language
语言选项(Language Option)
    -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 Option)
    -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 Option)
    -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 Option)
    -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 Option)
    -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 Option)
    -llibrary -nostartfiles -nostdlib -static -shared -symbolic -Xlinker option -Wl,option -u symbol
目录选项(Directory Option)
    -Bprefix -Idir -I- -Ldir
目标机选项(Target Option)
    -b machine -V version
配置相关选项(Configuration Dependent Option)

共9页 首页 上一页 [1] [2] [3] [4] [5下一页 尾页>
上一篇:
下一篇: UNIX命令大全
相关信息
相关评论
相关文章
字母检索 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z