简体   繁体   中英

How to turn on optimization in C source code?

Is it possible to write C code so that when it is compiled with

gcc -o foo foo.c

it in fact compiles foo.c with -O2?

I am using gcc 4.4.6.

最近的gcc知道#pragma GCC optimize pragma( http://gcc.gnu.org/onlinedocs/gcc/Function-Specific-Option-Pragmas.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM