delete-null-pointer-checks是一种优化手段,通过全局的数据流分析来识别和删除所有对空指针的检测操作。 编译器假定对空指针的解引用会造成程序终止。但因为有些环境下,这一结论并不一定成立,而O2,O3和Os时会开启此优化。 因此GCC增加了选项-fno-delete-null-pointer-checks 13-mcheck-zero-division/-mno-check-ze...
|| check_maybe_down (flag_reciprocal_math) || check_maybe_down (flag_fp_int_builtin_inexact)/* Strictly speaking only when the callee contains function calls that may end up setting errno. */|| check_maybe_up (flag_errno_math)))/* We do not want to make code compiled with exception...
This option instructs the compiler to check that the size of a variable length array is positive. -fsanitize=null This option enables pointer checking. Particularly, the application built with this option turned on will issue an error message when it tries to dereference a NULL pointer, or if...
gcc -c -Q -O1 --help=optimizers The following options control optimizations:-O<number>-Ofast-Og-Os-faggressive-loop-optimizations[enabled]-falign-functions[disabled]-falign-jumps[disabled]-falign-labels[disabled]-falign-loops[disabled]-fasynchronous-unwind-tables[enabled]-fbranch-count-reg[enable...
-Zs 只进行语法检查 syntax check only -Zd 仅要行号调试信息 line number debugging info only -vd{0|1} 禁用-启用 vtordisp disable-enable vtordisp -Zp[n] 在 n 字节边界上包装结构 pack structs on n-byte boundary -vm 指向成员的指针类型 type of pointers to members ...
强烈推荐开启-Wall -Wextra -Werror,将这些常见有问题的写法,从警告转化为编译期错误,迫使你经过一次理智检查(sanity-check)后,如果确认的确有需要,使用(void)x,[[fallthrough]]等特殊写法,阻止警告。如果需要关闭一部分不喜欢的警告,比如-Wall自带的-Wunused警告可以使用-Wno-unused关闭,如果只想把一部分警告转化...
-fno-bounds-check 关闭所有对数组访问的边界检查。该选项将提高数组索引的性能,但当超出数组边界时,可能会 造成不可接受的行为。 -freg-struct-return 如果struct和union足够小就通过寄存器返回,这将提高较小结构的效率。如果 不够小,无法容纳在一个寄存器中,将使用内存返回。建议仅在完全使用GCC编译的系统上才使用...
-Zs 只进行语法检查 syntax check only -Zd 仅要行号调试信息 line number debugging info only -vd{0|1} 禁用-启用 vtordisp disable-enable vtordisp -Zp[n] 在 n 字节边界上包装结构 pack structs on n-byte boundary -vm 指向成员的指针类型 type of pointers to members -Za 禁用扩展(暗指 -Op) dis...
Check that the pointer returned by "operator new" is non-null before attempting to modify the storage allocated. This check is normally unnecessary because the C++ standard specifies that "operator new" will only return 0 if it is declared throw(), in which case the compiler will always check...
-fcheck-new Check that the pointer returned by "operator new" is non-null before attempting to modify the storage allocated. This check is normally unnecessary because the C++ standard specifies that "operator new" only returns 0 if it is declared throw(), in which case the compiler always ...