Ubuntu Pastebin

Paste from adconrad at Wed, 24 May 2017 17:58: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
(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
Download as text