0
我试过“-U__GNUC__”,但预处理器的输出仍然包含“__attribute__”或类似的东西。如何让编译器丢弃那些非标准的东西?我的操作系统是OS X 10.10,当我与选项“-U__GNUC__”运行编译器,它抱怨:如何禁用clang的gnu扩展?
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/sys/cdefs.h:81:2:
warning:
"Unsupported compiler detected" [-W#warnings]
#warning "Unsupported compiler detected"
尝试使用-std =标志。 – 2015-03-13 06:53:56
仍然无法正常工作。 – noinput 2015-03-13 06:56:44
你为什么要这么做?很可能您的系统C库标头包含此类扩展名。 – 2015-03-13 07:03:21