gcc常见问题

显示系统所有预处理定义

显示 gcc 所有 define:

[root@localhost ~]# gcc -dM -E - < /dev/null

类似 g++ 还可以指定选项:

[root@localhost ~]# g++ -dM -E -x c++ /dev/null
[root@localhost ~]# g++ -dM -E -x c++ -std=c++11 /dev/null

显示支持的处理器和指令集

显示当前 gcc 支持的处理器:

[root@localhost ~]# gcc --version
gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6)
[root@localhost ~]# gcc -c -Q -march=native --help=target | grep march
  -march=                               silvermont