Ubuntu Pastebin

Paste from adconrad at Wed, 24 May 2017 18:20:03 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
(base)adconrad@nosferatu:~/opt$ cat foo.c 
#include <stdio.h>

int main() {
#ifdef __OPTIMIZE__
  int opt = __OPTIMIZE__;
#else
  int opt = 0;
#endif
  printf("%d\n", opt);
  return 1;
}
(base)adconrad@nosferatu:~/opt$ for i in 0 1 2 3 s; do gcc -O$i foo.c -o $i.o; done
(base)adconrad@nosferatu:~/opt$ for i in 0 1 2 3 s; do ./$i.o; done
0
1
1
1
1
(base)adconrad@nosferatu:~/opt$ for i in *.o; do echo $i; nm -D $i | grep _chk; done
0.o
1.o
                 U __printf_chk
2.o
                 U __printf_chk
3.o
                 U __printf_chk
s.o
                 U __printf_chk
(base)adconrad@nosferatu:~/opt$ 
Download as text