使用GCC帮助系统
后面在使用gcc帮助的时侯老是找不到自己想要的信息,但是指南巨长(有超过10^4页)。于是就RTFM找到一些使用gcc帮助系统找到自己须要信息的方式,当然就是gcc指南的帮助部份的内容。你们还有哪些方法都来讲讲,交流学校习。
gcc--help
下边是从gccmannual中节选下来的
Print(onthestandardoutput)adescriptionofthecommandline
optionsunderstoodbygcc.Ifthe-voptionisalsospecifiedthen
--helpwillalsobepassedontothevariousprocessesinvokedbygcc,
sothattheycandisplaythecommandlineoptionstheyaccept.Ifthe
-Wextraoptionhasalsobeenspecified(priortothe--helpoption),
thencommandlineoptionswhichhavenodocumentationassociatedwith
themwillalsobedisplayed.
复印gcc能辨识的命令行选项(到标准输出)。若果同时指定了-v选项LINUX虚机,这么--help选项会被传递给gcc调用的所有工具,这样才能同时显示所有工具能辨识的命令行选项了。倘若指定-Wextra选项,这么没有相关文档的命令行选项也会显示下来。
gcc--help会显示gcc常用的选项和帮助,例如编译器的各个阶段
-E编译进行到预编译就停止linux下gcc版本查看命令行,不继续汇编,编译或则链接
-S编译进行到生成汇编就停止,不编译和链接
-c编译成二补码对象就停止linux下gcc版本查看命令行,不链接
gcc--target-help
Print(onthestandardoutput)adescriptionoftarget-specificcommand
lineoptionsforeachtool.Forsometargetsextratarget-specific
informationmayalsobeprinted.
复印和目标平台相关的每位工具的命令行选项(到标准输出)。个别平台上会有额外的平台相关信息被复印下来。
gcc--help={class|[^]qualifier}[,...]
Print(onthestandardoutput)adescriptionofthecommandline
optionsunderstoodbythecompilerthatfitintoallspecifiedclasses
andqualifiers.Thesearethesupportedclasses:
复印编译器辨识的属于个别分类或则修饰符的命令行选项到标准输出。
支持的分类
optimizers优化器
Thiswilldisplayalloftheoptimizationoptionssupportedbythecompiler.显示编译器支持的所有优化选项
warnings警告
Thiswilldisplayalloftheoptionscontrollingwarningmessagesproducedbythecompiler.显示用于控制编译器形成警告信息的所有选项
target目标平台
Thiswilldisplaytarget-specificoptions.Unlikethe--target-helpoptionhowever,target-specificoptionsofthelinkerandassemblerwillnotbedisplayed.Thisisbecausethosetoolsdonotcurrentlysupporttheextended--help=syntax.显示和目标平台相关的选项
params参数设置
Thiswilldisplaythevaluesrecognizedbythe--paramoption.显示--param选项接受的值
language语言
Thiswilldisplaytheoptionssupportedforlanguage,wherelanguageisthenameofoneofthelanguagessupportedinthisversionofGCC.显示gcc支持的程序语言选项
common公共选项
Thiswilldisplaytheoptionsthatarecommontoalllanguages.显示所有语言都支持的公共选项
支持的修饰符
undocumented没有文档的
Displayonlythoseoptionswhichareundocumented.显示没有文档的选项
joined联合选项
Displayoptionswhichtakeanargumentthatappearsafteranequalsigninthesamecontinuouspieceoftext,suchas:--help=target.显示联合选项,像--help=target这些
separate单独选项
Displayoptionswhichtakeanargumentthatappearsasaseparatewordfollowingtheoriginaloption,suchas:-ooutput-file.显示单独选项linux手机,想-ooutput-file这些
示例:
--help=target,undocumented获取目标平台没有文档的帮助文档
--help=warnings,^joined,^undocumented获取控制编译器警告的所有有文档的单
独选项(^表示反选)
查询选项设置
在帮助选项后面加上-Q选项后就可以查看当前的选项配置情况而不是得到选项的描述。
示例:
gcc-Q-m64--help=target
查询x86_64目标平台的所有目标选项设置
gcc-Q--help=c
查询目标平台c语言的默认选项设置
gcc-Q--help=warnings,joined
查询警告控制的联合选项设置
资源
mangcc