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.
recent gcc knows a #pragma GCC optimize pragma (http://gcc.gnu.org/onlinedocs/gcc/Function-Specific-Option-Pragmas.html)
alias gcc='gcc -O2'gccto change this behavior. Beware, consumers of @marshall's new compiler!