(base)adconrad@nosferatu:~/opt$ cat foo.c
#include <stdio.h>
int main() {
printf("%d\n", __OPTIMIZE__);
return 1;
}
(base)adconrad@nosferatu:~/opt$ for i in 0 1 2 3 s; do gcc -O$i foo.c -o $i.o; done
foo.c: In function ‘main’:
foo.c:4:18: error: ‘__OPTIMIZE__’ undeclared (first use in this function)
printf("%d\n", __OPTIMIZE__);
^~~~~~~~~~~~
foo.c:4:18: note: each undeclared identifier is reported only once for each function it appears in
(base)adconrad@nosferatu:~/opt$ for i in *.o; do echo $i; nm -D $i | grep _chk; done
1.o
U __printf_chk
2.o
U __printf_chk
3.o
U __printf_chk
s.o
U __printf_chk