seh*_*ehe 29
GCC 4.4有一个属性:
int foo(int i) __attribute__((optimize("-O3")));
Run Code Online (Sandbox Code Playgroud)
它记录在:https://gcc.gnu.org/onlinedocs/gcc-5.1.0/gcc/Function-Attributes.html#index-g_t_0040code_007boptimize_007d-function-attribute-3195
flo*_*olo 18
GCC自4.4以来.这个#pragma GCC optimize ("whatever").我还建议来包装特定的代码,被注释与此编译与#pragma GCC push_options和#pragma GCC pop_options.第一个将保存更改前的选项,之后将恢复它们,其余代码将使用全局选项进行编译.
有关任何字符串的详细信息 ,您应该查看gcc文档,这里是最重要的部分:Arguments can either be numbers or strings. Numbers are assumed to be an optimization level. Strings that begin with O are assumed to be an optimization option, while other options are assumed to be used with a -f prefix..
这意味着,如果你不想在你的特定代码的任何优化你的一切应该仅仅是"0".