-cpp/-nocpp
启动或者关闭预处理过程
预处理以传统的方式运行。任何有关文件格式,行长度的限制都会被预处理到输出结果中。因此,建议使用-ffree-line-length-none or -ffixed-line-length-none options.
-W警告信息
-Wall
启动所有常见的警告信息。包括:-Waliasing,-Wampersand,-Wconversion,-Wsurprising,-Wc-binding-type,-Wintrinsics-std,-Wtabs,-Wintrinsic-shadow,-Wline-truncation,-Wtarget-lifetime,-Winteger-division,-Wreal-q-constant,-Wunused and -Wundefined-do-loop.
-Werror
将警告提高为错误
Turns all warnings into errors
x86 Options
-march=cpu-type
这些'-m'选项都是为x86计算机系列设置的
'native'
Using -march=cpu-type enables all instrucyion subsets supported by the local machine (hence the result might not run on different machines).编译器会根据本地计算机优化代码,因此程序再其他计算机上不一定能运行。Uing -mtune=native produces code optimized for the local machine under the constraints of the selected instruction set'x86-64'
A generic CPU with 64-bit extensions
'i386'
Original Intel i386 CPU
'i486''i586'/'pentium'
Intel Pentium CPU with no MMX support
总而言之,和cpu类型有关
-mtune
Tune to cpu-type everything applicable about the generated code , except for the ABI and the set of avaliable instructions
-mtune专门产生指定cpu型号的代码,而-march可以产生在本地不被运行的代码
-mtune除了和-march一样的参数之外,还有两个额外的选项
'generic'
Produce code optimized for the most common IA32/AMD64/EM64T processors.在不知道用户的cpu情况下,使用generic选项。如果知道,应该选择对应的选项
'intel'
Produce code optimized for the most current Intel processors, which are Haswell and Silvermont for this version of GCC.
为intel处理器优化代码
debug选项 -ffpe-trap=llist list=invalid,zero,overflow等浮点数相关选项 invalid:SQRT(-1.0) zero: division by zero overflow: overflow in a floating point operation underflow: underflow in a floating point operation inexact: loss of precision during operation denormal: operation on a denormal value -fno-backtrace When a serious runtime error is encountered or a deadly signal is emitted(segmentation fault, illegal instruction, bus error, floating-point exception, and the other POSIX signals that have the action ‘core’), the Fortran runtime library tries to output a backtrace of the error. -fno-backtrace disables the backtrace generation.
preprocessing预处理-cpp/-nocpp启动或者关闭预处理过程预处理以传统的方式运行。任何有关文件格式,行长度的限制都会被预处理到输出结果中。因此,建议使用-ffree-line-length-none or -ffixed-line-length-none options.-W警告信息-Wall启动所有常见的警告信息。包括:-Waliasing,-Wampersand,-Wconversion,-Wsurprising,-Wc-binding-type,-Wintrin.