本帖最后由 ISO14882 于 2018-8-21 20:46 编辑
GNU兼容的编译器是-x language <文件名>-x language
Specify explicitly the language for the following input files (rather than letting the compiler choose a default based on the file name suffix). This option applies to all following input files until the next ‘-x’ option. Possible values for language are: c c-header cpp-output c++ c++-header c++-cpp-output objective-c objective-c-header objective-c-cpp-output objective-c++ objective-c++-header objective-c++-cpp-output assembler assembler-with-cpp ada f77 f77-cpp-input f95 f95-cpp-input go brig -x none Turn off any specification of a language, so that subsequent files are handled according to their file name suffixes (as they are if ‘-x’ has not been used at
all).
微软的cl是
/Tc /TC 指定 C 源文件。
/Tp /TP 指定 C++ 源文件。
详见: https://msdn.microsoft.com/zh-cn/library/19z1t1wy.aspx https://msdn.microsoft.com/zh-cn/library/032xwy55.aspx
还有, visual studio 的 C 编译器不支持 C99, 还是用Clang/C2 吧 (=・ω・=)
gcc.pdf
(2.66 MB, 下载次数: 27)
|